-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
- Loading branch information
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,2 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
.vscode | ||
|
||
.DS_Store | ||
|
||
/dist | ||
/deno_dist | ||
|
||
/node_modules |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import type { Unite } from "./tools/Unite"; | ||
import type { StrictEquals } from "./tools/StrictEquals"; | ||
/** https://docs.tsafe.dev/main/equals */ | ||
export declare type Equals<A1, A2> = StrictEquals<Unite<A1>, Unite<A2>>; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** https://docs.tsafe.dev/methodnames */ | ||
export declare type MethodNames<Api> = NonNullable<{ | ||
[Key in keyof Api]: Api[Key] extends ((...args: any[]) => unknown) | undefined ? Key : never; | ||
}[keyof Api]>; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/** https://docs.tsafe.dev/main/not */ | ||
export declare type Not<B extends boolean> = B extends true ? false : true; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type { Parameters } from "./Parameters"; | ||
declare type NonUndefined<T> = T extends undefined ? never : T; | ||
/** Shorthand for Parameters<typeof f>[0] https://docs.tsafe.dev/param0 */ | ||
export declare type Param0<T extends ((...args: any[]) => unknown) | null | undefined | false | ""> = [ | ||
Parameters<T> | ||
] extends [never] ? never : Parameters<T> extends [] ? void : NonUndefined<Parameters<T>[0]>; | ||
export {}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/** https://docs.tsafe.dev/parameters */ | ||
export declare type Parameters<T extends ((...args: any[]) => unknown) | null | undefined | false | ""> = T extends (...args: infer P) => any ? P : never; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
declare type OptionalKeyof<T extends Record<string, unknown>> = Exclude<{ | ||
[Key in keyof T]: T extends Record<Key, T[Key]> ? never : Key; | ||
}[keyof T], undefined>; | ||
/** | ||
* PickOptionals<{ p1: string; p2?: string; p3?: number; }> | ||
* is the type | ||
* { p2: string; p3: number; } | ||
*/ | ||
export declare type PickOptionals<T extends Record<string, unknown>> = Required<Pick<T, OptionalKeyof<T>>>; | ||
export {}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/** Always return null but pretends it returns an object of type T */ | ||
export declare function Reflect<T>(): T; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/** https://docs.tsafe.dev/returntype */ | ||
export declare type ReturnType<T extends ((...args: any[]) => unknown) | undefined | null | false | ""> = T extends (...args: any[]) => infer R ? (R extends PromiseLike<infer J> ? J : R) : never; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* Use case: | ||
* declare const pr: Promise<string[]>; | ||
* const x: UnpackPromise<typeof pr>; <== x is string[] | ||
*/ | ||
export declare type UnpackPromise<T extends PromiseLike<unknown> | undefined | null | false | ""> = T extends PromiseLike<infer U> ? U : never; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** @see <https://docs.tsafe.dev/assert#error-thrown> */ | ||
export declare class AssertionError extends Error { | ||
constructor(msg: string | undefined); | ||
} | ||
/** https://docs.tsafe.dev/assert */ | ||
export declare function assert<_T extends true>(condition?: any, msg?: string): asserts condition; |