Skip to content

type

Type utilities.

ClassDescription
TypeAsserterA helper that captures a type parameter and provides methods for compile-time exhaustiveness checks.
TypeDescription
ExactKeysA type that represents the keys of an object as strings and asserts that all keys are present in a list of keys.
ExactMembersA type that represents the members of a type.
ExtractEventMapDerives an event map (\{ eventName: [callbackArgs] \}) from a type exposing an overloaded on(name, callback) method — e.g. Obsidian’s Workspace / Vault / MetadataCache. Each on overload becomes one entry keyed by the event name, with the callback’s parameters as a labeled tuple; the wide on(name: string, …) catch-all overload is dropped. The map auto-tracks upstream overloads (no hand-authoring). It cannot reconstruct genuinely generic overloads, but Obsidian’s event overloads are all concrete string-literal ones.
MaybeReturnA type that represents a return value that may be void.
PropertyValuesA type that represents the values of an object.
StringKeysA type that represents the keys of an object as strings.