mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-07 02:30:12 +00:00
Merge pull request #34395 from jaulz/fix/js-yaml
fix(js-yaml): predicate is a function and not a string
This commit is contained in:
4
types/js-yaml/index.d.ts
vendored
4
types/js-yaml/index.d.ts
vendored
@@ -15,7 +15,7 @@ export class Type {
|
||||
resolve(data: any): boolean;
|
||||
construct(data: any): any;
|
||||
instanceOf: object | null;
|
||||
predicate: string | null;
|
||||
predicate: ((data: object) => boolean) | null;
|
||||
represent: ((data: object) => any) | { [x: string]: (data: object) => any; } | null;
|
||||
defaultStyle: string | null;
|
||||
styleAliases: { [x: string]: any; };
|
||||
@@ -82,7 +82,7 @@ export interface TypeConstructorOptions {
|
||||
resolve?: (data: any) => boolean;
|
||||
construct?: (data: any) => any;
|
||||
instanceOf?: object;
|
||||
predicate?: string;
|
||||
predicate?: (data: object) => boolean;
|
||||
represent?: ((data: object) => any) | { [x: string]: (data: object) => any };
|
||||
defaultStyle?: string;
|
||||
styleAliases?: { [x: string]: any; };
|
||||
|
||||
@@ -23,7 +23,7 @@ const typeConstructorOptions: TypeConstructorOptions = {
|
||||
resolve: fn,
|
||||
construct: fn,
|
||||
instanceOf: obj,
|
||||
predicate: str,
|
||||
predicate: (obj) => false,
|
||||
represent: fn,
|
||||
defaultStyle: str,
|
||||
styleAliases: map
|
||||
@@ -104,7 +104,7 @@ type.resolve;
|
||||
type.construct;
|
||||
// $ExpectType object | null
|
||||
type.instanceOf;
|
||||
// $ExpectType string | null
|
||||
// $ExpectType ((data: object) => boolean) | null
|
||||
type.predicate;
|
||||
// $ExpectType ((data: object) => any) | { [x: string]: (data: object) => any; } | null
|
||||
type.represent;
|
||||
|
||||
Reference in New Issue
Block a user