diff options
Diffstat (limited to 'op_crates/web/internal.d.ts')
-rw-r--r-- | op_crates/web/internal.d.ts | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/op_crates/web/internal.d.ts b/op_crates/web/internal.d.ts index 04fc061bb..d43332e4b 100644 --- a/op_crates/web/internal.d.ts +++ b/op_crates/web/internal.d.ts @@ -191,6 +191,8 @@ declare namespace globalThis { * Convert a value into a `VoidFunction` (() => void). */ VoidFunction(v: any, opts?: ValueConverterOpts): () => void; + + [type: string]: (v: any, opts: ValueConverterOpts) => any; }; /** @@ -205,7 +207,7 @@ declare namespace globalThis { declare interface DictionaryMember { key: string; converter: (v: any, opts: ValueConverterOpts) => any; - defaultValue?: boolean; + defaultValue?: any; required?: boolean; } @@ -231,6 +233,41 @@ declare namespace globalThis { declare function createNullableConverter<T>( converter: (v: any, opts: ValueConverterOpts) => T, ): (v: any, opts: ValueConverterOpts) => T | null; + + /** + * Create a converter that converts a sequence of the inner type. + */ + declare function createSequenceConverter<T>( + converter: (v: any, opts: ValueConverterOpts) => T, + ): (v: any, opts: ValueConverterOpts) => T[]; + + /** + * Throw an illegal constructor error. + */ + declare function illegalConstructor(): never; + + /** + * The branding symbol. + */ + declare const brand: unique symbol; + + /** + * Create a branded instance of an interface. + */ + declare function createBranded(self: any): any; + + /** + * Assert that self is branded. + */ + declare function assertBranded(self: any, type: any): void; + + /** + * Create a converter for interfaces. + */ + declare function createInterfaceConverter( + name: string, + prototype: any, + ): (v: any, opts: ValueConverterOpts) => any; } declare var url: { |