-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* esm import style * fixed esm in package.json
- Loading branch information
1 parent
c619e81
commit 88d8f96
Showing
15 changed files
with
126 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
export type ArrayItem<T extends IterableIterator<any> | ArrayLike<any>> | ||
= T extends { [Symbol.iterator](): IterableIterator<infer P> } | ||
export type ArrayItem<T extends IterableIterator<any> | ArrayLike<any>> = | ||
T extends { [Symbol.iterator](): IterableIterator<infer P> } | ||
? P | ||
: T extends ArrayLike<infer P> | ||
? P | ||
: never; | ||
? P | ||
: never; | ||
|
||
type BuildMinArray<TItem, TMin extends number, TFix extends TItem[]> | ||
= TFix['length'] extends TMin | ||
? TFix | ||
: BuildMinArray<TItem, TMin, [...TFix, TItem]>; | ||
export type MinArray<TItem, TMin extends number> = [...BuildMinArray<TItem, TMin, []>, ...TItem[]]; | ||
type BuildMinArray< | ||
TItem, | ||
TMin extends number, | ||
TFix extends TItem[] | ||
> = TFix['length'] extends TMin | ||
? TFix | ||
: BuildMinArray<TItem, TMin, [...TFix, TItem]>; | ||
export type MinArray<TItem, TMin extends number> = [ | ||
...BuildMinArray<TItem, TMin, []>, | ||
...TItem[] | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
export type StandardConstructor<T = any, A extends any[] = any[]> = new (...args: A) => T; | ||
export type AbstractConstructor<T = any, A extends any[] = any[]> = abstract new (...params: A) => T; | ||
export type Constructor<T = any> = StandardConstructor<T> | AbstractConstructor<T>; | ||
export type ConstructorInstance<C extends Constructor> | ||
= C extends StandardConstructor<infer Instance> | ||
export type StandardConstructor<T = any, A extends any[] = any[]> = new ( | ||
...args: A | ||
) => T; | ||
export type AbstractConstructor< | ||
T = any, | ||
A extends any[] = any[] | ||
> = abstract new (...params: A) => T; | ||
export type Constructor<T = any> = | ||
| StandardConstructor<T> | ||
| AbstractConstructor<T>; | ||
export type ConstructorInstance<C extends Constructor> = | ||
C extends StandardConstructor<infer Instance> | ||
? Instance | ||
: C extends AbstractConstructor<infer Instance> | ||
? Instance | ||
: never; | ||
export type ConstructorParameters<C extends Constructor> | ||
= C extends StandardConstructor<any, infer Arguments> | ||
? Instance | ||
: never; | ||
export type ConstructorParameters<C extends Constructor> = | ||
C extends StandardConstructor<any, infer Arguments> | ||
? Arguments | ||
: C extends AbstractConstructor<any, infer Arguments> | ||
? Arguments | ||
: never; | ||
? Arguments | ||
: never; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
export type Dictionary<T = any, K extends string | number = string> = { | ||
[key in K]?: T; | ||
}; | ||
export type ReadonlyDictionary<T = any, K extends string | number = string> = Readonly<Dictionary<T,K>>; | ||
export type ReadonlyDictionary< | ||
T = any, | ||
K extends string | number = string | ||
> = Readonly<Dictionary<T, K>>; | ||
export type DictionaryKey<D> = D extends Dictionary<any, infer P> ? P : never; | ||
export type DictionaryValue<D> = D extends Dictionary<infer P> ? P : never; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
import type { EventArgs } from './args'; | ||
import type { EventArgs } from './args/index.js'; | ||
|
||
export type EventSubscription<TSender, TArgs extends EventArgs | void = void> | ||
= (identifier_: string, callback_: EventCallback<TSender, TArgs>) => boolean; | ||
|
||
export type EventSubscription< | ||
TSender, | ||
TArgs extends EventArgs | void = void | ||
> = (identifier_: string, callback_: EventCallback<TSender, TArgs>) => boolean; | ||
|
||
export type EventUnsubscription = (identifier_: string) => boolean; | ||
|
||
export type EventCallback<TSender, TArgs extends EventArgs | void = void> | ||
= (sender_: TSender, eventArgs_: TArgs) => void; | ||
export type EventCallback<TSender, TArgs extends EventArgs | void = void> = ( | ||
sender_: TSender, | ||
eventArgs_: TArgs | ||
) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
import { EnumerableObject } from './enumerable'; | ||
import { EnumerableObject } from './enumerable.js'; | ||
|
||
export type { ArrayItem, MinArray } from './array'; | ||
export type { ArrayItem, MinArray } from './array.js'; | ||
export type { | ||
AbstractConstructor, | ||
Constructor, | ||
ConstructorInstance, | ||
ConstructorParameters, | ||
StandardConstructor | ||
} from './constructor'; | ||
} from './constructor.js'; | ||
export type { | ||
Dictionary, | ||
DictionaryKey, | ||
DictionaryValue, | ||
ReadonlyDictionary | ||
} from './dictionary'; | ||
export { Disposable } from './disposable'; | ||
export { DisposableBase } from './disposable/base'; | ||
} from './dictionary.js'; | ||
export { DisposableBase } from './disposable/base.js'; | ||
export { Disposable } from './disposable/index.js'; | ||
export type { | ||
Enumerable, | ||
EnumerableBase, | ||
EnumerableEntry, | ||
EnumerableValue | ||
} from './enumerable'; | ||
export { Event } from './event'; | ||
export { EventArgs } from './event/args'; | ||
export { CancelEventArgs } from './event/args/cancel'; | ||
export { EventHandler } from './event/handler'; | ||
} from './enumerable.js'; | ||
export { CancelEventArgs } from './event/args/cancel.js'; | ||
export { EventArgs } from './event/args/index.js'; | ||
export { EventHandler } from './event/handler.js'; | ||
export { Event } from './event/index.js'; | ||
export type { | ||
EventCallback, | ||
EventSubscription, | ||
EventUnsubscription | ||
} from './event/types'; | ||
export type { PublicMembers } from './mapping'; | ||
} from './event/types.js'; | ||
export type { PublicMembers } from './mapping.js'; | ||
export { EnumerableObject }; | ||
|
||
export const enumerableObject = new EnumerableObject(); |
Oops, something went wrong.