@vertexvis/utils 0.24.5-canary.6 → 1.0.0-testing.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- /**
2
- * Adds a listener to the given `target`, and returns a promise that
3
- * resolves with the first event emitted of the given `type`.
4
- *
5
- * @param target The target to add an event listener to.
6
- * @param type The event type to listen for.
7
- * @param opts Options to pass to `addEventListener`.
8
- * @returns A promise that resolves with the first event emitted of `type`.
9
- */
10
- export declare function once<E extends Event>(target: EventTarget, type: string, opts?: boolean | AddEventListenerOptions): Promise<E>;
1
+ /**
2
+ * Adds a listener to the given `target`, and returns a promise that
3
+ * resolves with the first event emitted of the given `type`.
4
+ *
5
+ * @param target The target to add an event listener to.
6
+ * @param type The event type to listen for.
7
+ * @param opts Options to pass to `addEventListener`.
8
+ * @returns A promise that resolves with the first event emitted of `type`.
9
+ */
10
+ export declare function once<E extends Event>(target: EventTarget, type: string, opts?: boolean | AddEventListenerOptions): Promise<E>;
package/dist/index.d.ts CHANGED
@@ -1,19 +1,19 @@
1
- /**
2
- * @module Utils
3
- */
4
- import * as Async from './async';
5
- import * as BinaryReader from './binaryReader';
6
- import * as Color from './color';
7
- import * as EventTargets from './eventTargets';
8
- import * as Mapper from './mapper';
9
- import * as Objects from './objects';
10
- import * as Range from './range';
11
- import * as Sets from './sets';
12
- import * as Strings from './strings';
13
- import * as Uri from './uri';
14
- import * as UUID from './uuid';
15
- export * from './disposable';
16
- export * from './eventDispatcher';
17
- export * from './mappedTypes';
18
- export * from './predicate';
19
- export { Async, BinaryReader, Color, EventTargets, Mapper, Objects, Range, Sets, Strings, Uri, UUID, };
1
+ /**
2
+ * @module Utils
3
+ */
4
+ import * as Async from './async';
5
+ import * as BinaryReader from './binaryReader';
6
+ import * as Color from './color';
7
+ import * as EventTargets from './eventTargets';
8
+ import * as Mapper from './mapper';
9
+ import * as Objects from './objects';
10
+ import * as Range from './range';
11
+ import * as Sets from './sets';
12
+ import * as Strings from './strings';
13
+ import * as Uri from './uri';
14
+ import * as UUID from './uuid';
15
+ export * from './disposable';
16
+ export * from './eventDispatcher';
17
+ export * from './mappedTypes';
18
+ export * from './predicate';
19
+ export { Async, BinaryReader, Color, EventTargets, Mapper, Objects, Range, Sets, Strings, Uri, UUID, };
@@ -1,49 +1,49 @@
1
- /**
2
- * This file is only for mapped TypeScript types. It should NOT include
3
- * constants classes or methods.
4
- */
5
- /**
6
- * A type that recursively makes each property of `T` optional.
7
- *
8
- * @example
9
- * ```
10
- * type Foo = { a: number };
11
- * type Bar = { foo: Foo };
12
- * type Baz = DeepPartial<Bar>; // { foo?: { a?: number } }
13
- * ```
14
- */
15
- export declare type DeepPartial<T> = T extends Record<string, unknown> ? {
16
- [K in keyof T]?: DeepPartial<T[K]>;
17
- } : T;
18
- /**
19
- * A type that recursively makes each property of `T` required.
20
- * Optionally excluding a nested path specified by a list of keys.
21
- *
22
- * @example
23
- * ```
24
- * type Foo = { a?: { c?: number }, b?: string };
25
- * type Bar = { foo: Foo };
26
- * type Baz = DeepRequired<Bar, []>; // { foo: { a: { c: number }, b: string } }
27
- * type Baz = DeepRequired<Bar, ['a', 'c']>; // { foo: { a: { c?: number }, b: string } }
28
- * type Baz = DeepRequired<Bar, ['a'] | ['b']>; // { foo: { a: { c?: number }, b?: string } }
29
- * ```
30
- */
31
- export declare type DeepRequired<T, P extends string[]> = T extends unknown[] ? T : T extends Record<string, unknown> ? Pick<T, Extract<keyof T, P[0]>> & Required<{
32
- [K in Exclude<keyof T, P[0]>]: NonNullable<DeepRequired<T[K], ShiftUnion<K, P>>>;
33
- }> : T;
34
- declare type Shift<T extends unknown[]> = ((...t: T) => unknown) extends (first: unknown, ...rest: infer Rest) => unknown ? Rest : never;
35
- declare type ShiftUnion<P extends PropertyKey, T extends unknown[]> = T extends unknown[] ? (T[0] extends P ? Shift<T> : never) : never;
36
- /**
37
- * A type that extends `Required` that in addition to making fields
38
- * not undefined, also makes them not nullable.
39
- *
40
- * @example
41
- * ```
42
- * type Foo = { a?: number | null };
43
- * type Bar = RequiredAndNonNullable<Bar>; // { a: number }
44
- * ```
45
- */
46
- export declare type RequiredAndNonNullable<T> = Required<{
47
- [P in keyof T]: NonNullable<T[P]>;
48
- }>;
49
- export {};
1
+ /**
2
+ * This file is only for mapped TypeScript types. It should NOT include
3
+ * constants classes or methods.
4
+ */
5
+ /**
6
+ * A type that recursively makes each property of `T` optional.
7
+ *
8
+ * @example
9
+ * ```
10
+ * type Foo = { a: number };
11
+ * type Bar = { foo: Foo };
12
+ * type Baz = DeepPartial<Bar>; // { foo?: { a?: number } }
13
+ * ```
14
+ */
15
+ export type DeepPartial<T> = T extends Record<string, unknown> ? {
16
+ [K in keyof T]?: DeepPartial<T[K]>;
17
+ } : T;
18
+ /**
19
+ * A type that recursively makes each property of `T` required.
20
+ * Optionally excluding a nested path specified by a list of keys.
21
+ *
22
+ * @example
23
+ * ```
24
+ * type Foo = { a?: { c?: number }, b?: string };
25
+ * type Bar = { foo: Foo };
26
+ * type Baz = DeepRequired<Bar, []>; // { foo: { a: { c: number }, b: string } }
27
+ * type Baz = DeepRequired<Bar, ['a', 'c']>; // { foo: { a: { c?: number }, b: string } }
28
+ * type Baz = DeepRequired<Bar, ['a'] | ['b']>; // { foo: { a: { c?: number }, b?: string } }
29
+ * ```
30
+ */
31
+ export type DeepRequired<T, P extends string[]> = T extends unknown[] ? T : T extends Record<string, unknown> ? Pick<T, Extract<keyof T, P[0]>> & Required<{
32
+ [K in Exclude<keyof T, P[0]>]: NonNullable<DeepRequired<T[K], ShiftUnion<K, P>>>;
33
+ }> : T;
34
+ type Shift<T extends unknown[]> = ((...t: T) => unknown) extends (first: unknown, ...rest: infer Rest) => unknown ? Rest : never;
35
+ type ShiftUnion<P extends PropertyKey, T extends unknown[]> = T extends unknown[] ? (T[0] extends P ? Shift<T> : never) : never;
36
+ /**
37
+ * A type that extends `Required` that in addition to making fields
38
+ * not undefined, also makes them not nullable.
39
+ *
40
+ * @example
41
+ * ```
42
+ * type Foo = { a?: number | null };
43
+ * type Bar = RequiredAndNonNullable<Bar>; // { a: number }
44
+ * ```
45
+ */
46
+ export type RequiredAndNonNullable<T> = Required<{
47
+ [P in keyof T]: NonNullable<T[P]>;
48
+ }>;
49
+ export {};