mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-08 11:10:03 +00:00
[js-yaml] Revert return type of loader functions to any (#26883)
Reverts https://github.com/DefinitelyTyped/DefinitelyTyped/pull/24385
This commit is contained in:
committed by
Mohamed Hegazy
parent
52a1ad8ea6
commit
ca19f9ce6c
10
types/js-yaml/index.d.ts
vendored
10
types/js-yaml/index.d.ts
vendored
@@ -6,10 +6,8 @@
|
||||
|
||||
export as namespace jsyaml;
|
||||
|
||||
export type DocumentLoadResult = object | undefined;
|
||||
|
||||
export function safeLoad(str: string, opts?: LoadOptions): DocumentLoadResult;
|
||||
export function load(str: string, opts?: LoadOptions): DocumentLoadResult;
|
||||
export function safeLoad(str: string, opts?: LoadOptions): any;
|
||||
export function load(str: string, opts?: LoadOptions): any;
|
||||
|
||||
export class Type {
|
||||
constructor(tag: string, opts?: TypeConstructorOptions);
|
||||
@@ -30,10 +28,10 @@ export class Schema implements SchemaDefinition {
|
||||
static create(schemas: Schema[] | Schema, types: Type[] | Type): Schema;
|
||||
}
|
||||
|
||||
export function safeLoadAll(str: string, iterator?: undefined, opts?: LoadOptions): DocumentLoadResult[];
|
||||
export function safeLoadAll(str: string, iterator?: undefined, opts?: LoadOptions): any[];
|
||||
export function safeLoadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): undefined;
|
||||
|
||||
export function loadAll(str: string, iterator?: undefined, opts?: LoadOptions): DocumentLoadResult[];
|
||||
export function loadAll(str: string, iterator?: undefined, opts?: LoadOptions): any[];
|
||||
|
||||
export function loadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): undefined;
|
||||
|
||||
|
||||
@@ -109,19 +109,19 @@ type.styleAliases;
|
||||
|
||||
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
|
||||
// $ExpectType DocumentLoadResult
|
||||
// $ExpectType any
|
||||
yaml.safeLoad(str);
|
||||
// $ExpectType DocumentLoadResult
|
||||
// $ExpectType any
|
||||
yaml.safeLoad(str, loadOpts);
|
||||
|
||||
// $ExpectType DocumentLoadResult
|
||||
// $ExpectType any
|
||||
yaml.load(str);
|
||||
// $ExpectType DocumentLoadResult
|
||||
// $ExpectType any
|
||||
yaml.load(str, loadOpts);
|
||||
|
||||
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
|
||||
// $ExpectType DocumentLoadResult[]
|
||||
// $ExpectType any[]
|
||||
yaml.safeLoadAll(str);
|
||||
|
||||
// $ExpectType undefined
|
||||
@@ -132,10 +132,10 @@ yaml.safeLoadAll(str, (doc) => {
|
||||
yaml.safeLoadAll(str, (doc) => {
|
||||
value = doc;
|
||||
}, loadOpts);
|
||||
// $ExpectType DocumentLoadResult[]
|
||||
// $ExpectType any[]
|
||||
value = yaml.safeLoadAll(str, undefined, loadOpts);
|
||||
|
||||
// $ExpectType DocumentLoadResult[]
|
||||
// $ExpectType any[]
|
||||
value = yaml.loadAll(str);
|
||||
|
||||
// $ExpectType undefined
|
||||
@@ -146,7 +146,7 @@ yaml.loadAll(str, (doc) => {
|
||||
yaml.loadAll(str, (doc) => {
|
||||
value = doc;
|
||||
}, loadOpts);
|
||||
// $ExpectType DocumentLoadResult[]
|
||||
// $ExpectType any[]
|
||||
value = yaml.loadAll(str, undefined, loadOpts);
|
||||
|
||||
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
|
||||
Reference in New Issue
Block a user