-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12b9f5d
commit a1e2372
Showing
6 changed files
with
51 additions
and
46 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,44 +1,2 @@ | ||
/** Read-write accessor. */ | ||
//deno-lint-ignore no-explicit-any | ||
export type rw = any | ||
|
||
/** Callback function. */ | ||
// deno-lint-ignore ban-types | ||
export type callback = Function | ||
|
||
/** Record. */ | ||
export type record<T = unknown> = Record<PropertyKey, T> | ||
|
||
/** Extract key type from {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map | Map}. */ | ||
export type MapKey<T> = T extends Map<infer U, unknown> ? U : never | ||
|
||
/** Extract value type from {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map | Map}. */ | ||
export type MapValue<T> = T extends Map<unknown, infer U> ? U : never | ||
|
||
/** Extract value type from {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set | Set}. */ | ||
export type SetValue<T> = T extends Set<infer U> ? U : never | ||
|
||
/** Extract key type from {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakMap | WeakMap}. */ | ||
export type WeakMapKey<T> = T extends WeakMap<infer U, unknown> ? U : never | ||
|
||
/** Extract value type from {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakMap | WeakMap}. */ | ||
export type WeakMapValue<T> = T extends WeakMap<WeakKey, infer U> ? U : never | ||
|
||
/** Extract value type from {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakSet | WeakSet}. */ | ||
export type WeakSetValue<T> = T extends WeakSet<infer U> ? U : never | ||
|
||
/** Optional type. */ | ||
export type Optional<T> = T | undefined | ||
|
||
/** Nullable type. */ | ||
export type Nullable<T> = T | null | ||
|
||
/** Promisable type. */ | ||
export type Promisable<T> = T | Promise<T> | ||
|
||
/** Arrayable type. */ | ||
export type Arrayable<T> = T | Array<T> | ||
|
||
/** Extract function argument. */ | ||
// deno-lint-ignore no-explicit-any | ||
export type Arg<T extends ((...args: any[]) => any), index extends number = 0, required extends boolean = false> = required extends true ? NonNullable<Parameters<T>[index]> : Parameters<T>[index] | ||
export type * from "./types.ts" | ||
export * from "./func.ts" |
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 +1 @@ | ||
import "./mod.ts" | ||
import "./mod.ts" |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** Read-write accessor. */ | ||
//deno-lint-ignore no-explicit-any | ||
export type rw = any | ||
|
||
/** Callback function. */ | ||
// deno-lint-ignore ban-types | ||
export type callback = Function | ||
|
||
/** Record. */ | ||
export type record<T = unknown> = Record<PropertyKey, T> | ||
|
||
/** Extract key type from {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map | Map}. */ | ||
export type MapKey<T> = T extends Map<infer U, unknown> ? U : never | ||
|
||
/** Extract value type from {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map | Map}. */ | ||
export type MapValue<T> = T extends Map<unknown, infer U> ? U : never | ||
|
||
/** Extract value type from {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set | Set}. */ | ||
export type SetValue<T> = T extends Set<infer U> ? U : never | ||
|
||
/** Extract key type from {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakMap | WeakMap}. */ | ||
export type WeakMapKey<T> = T extends WeakMap<infer U, unknown> ? U : never | ||
|
||
/** Extract value type from {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakMap | WeakMap}. */ | ||
export type WeakMapValue<T> = T extends WeakMap<WeakKey, infer U> ? U : never | ||
|
||
/** Extract value type from {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakSet | WeakSet}. */ | ||
export type WeakSetValue<T> = T extends WeakSet<infer U> ? U : never | ||
|
||
/** Optional type. */ | ||
export type Optional<T> = T | undefined | ||
|
||
/** Nullable type. */ | ||
export type Nullable<T> = T | null | ||
|
||
/** Promisable type. */ | ||
export type Promisable<T> = T | Promise<T> | ||
|
||
/** Arrayable type. */ | ||
export type Arrayable<T> = T | Array<T> | ||
|
||
/** Extract function argument. */ | ||
// deno-lint-ignore no-explicit-any | ||
export type Arg<T extends ((...args: any[]) => any), index extends number = 0, required extends boolean = false> = required extends true ? NonNullable<Parameters<T>[index]> : Parameters<T>[index] |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
import "./types.ts" |