-
Notifications
You must be signed in to change notification settings - Fork 2k
Added .d.ts
files for test utils
#2616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,4 @@ | ||
export declare const bigSchemaSDL: string; | ||
export declare const bigSchemaIntrospectionResult: { data: unknown }; | ||
export declare const kitchenSinkSDL: string; | ||
export declare const kitchenSinkQuery: string; |
This file contains hidden or 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 hidden or 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,15 @@ | ||
export interface ObjMap<T> { | ||
[key: string]: T; | ||
__proto__: never; | ||
} | ||
|
||
export type ObjMapLike<T> = ObjMap<T> | { [key: string]: T }; | ||
|
||
export interface ReadOnlyObjMap<T> { | ||
readonly [key: string]: T; | ||
__proto__: never; | ||
} | ||
|
||
export type ReadOnlyObjMapLike<T> = | ||
| ReadOnlyObjMap<T> | ||
| { readonly [key: string]: T }; |
This file contains hidden or 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,10 @@ | ||
/** | ||
* Given [ A, B, C ] return ' Did you mean A, B, or C?'. | ||
*/ | ||
declare function didYouMean(suggestions: ReadonlyArray<string>): string; | ||
declare function didYouMean( | ||
subMessage: string, | ||
suggestions: ReadonlyArray<string>, | ||
): string; | ||
|
||
export default didYouMean; |
This file contains hidden or 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,4 @@ | ||
/** | ||
* Returns the first argument it receives. | ||
*/ | ||
export default function identityFunc<T>(x?: T): T; |
This file contains hidden or 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,4 @@ | ||
/** | ||
* Used to print values in error messages. | ||
*/ | ||
export default function inspect(value: any): string; |
This file contains hidden or 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,5 @@ | ||
/** | ||
* A replacement for instanceof which includes an error warning when multi-realm | ||
* constructors are detected. | ||
*/ | ||
export default function instanceOf(value: any, constructor: any): boolean; |
This file contains hidden or 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 @@ | ||
export default function invariant(condition: any, message?: string): void; |
This file contains hidden or 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,22 @@ | ||
/** | ||
* Returns true if the provided object is an Object (i.e. not a string literal) | ||
* and is either Iterable or Array-like. | ||
* | ||
* This may be used in place of [Array.isArray()][isArray] to determine if an | ||
* object should be iterated-over. It always excludes string literals and | ||
* includes Arrays (regardless of if it is Iterable). It also includes other | ||
* Array-like objects such as NodeList, TypedArray, and Buffer. | ||
* | ||
* @example | ||
* | ||
* isCollection([ 1, 2, 3 ]) // true | ||
* isCollection('ABC') // false | ||
* isCollection({ length: 1, 0: 'Alpha' }) // true | ||
* isCollection({ key: 'value' }) // false | ||
* isCollection(new Map()) // true | ||
* | ||
* @param obj | ||
* An Object value which might implement the Iterable or Array-like protocols. | ||
* @return true if Iterable or Array-like Object. | ||
*/ | ||
export default function isCollection(obj: any): boolean; |
This file contains hidden or 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,5 @@ | ||
/** | ||
* Return true if `value` is object-like. A value is object-like if it's not | ||
* `null` and has a `typeof` result of "object". | ||
*/ | ||
export default function isObjectLike(value: any): boolean; |
This file contains hidden or 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,3 @@ | ||
declare const nodejsCustomInspectSymbol: symbol | undefined; | ||
|
||
export default nodejsCustomInspectSymbol; |
This file contains hidden or 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,8 @@ | ||
/** | ||
* Given an invalid input string and a list of valid options, returns a filtered | ||
* list of valid options sorted based on their similarity with the input. | ||
*/ | ||
export default function suggestionList( | ||
input: string, | ||
options: ReadonlyArray<string>, | ||
): Array<string>; |
This file contains hidden or 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,11 @@ | ||
import { | ||
ObjMap, | ||
ObjMapLike, | ||
ReadOnlyObjMap, | ||
ReadOnlyObjMapLike, | ||
} from './ObjMap'; | ||
|
||
declare function toObjMap<T>(obj: ObjMapLike<T>): ObjMap<T>; | ||
declare function toObjMap<T>(obj: ReadOnlyObjMapLike<T>): ReadOnlyObjMap<T>; | ||
|
||
export default toObjMap; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.