import { HttpsProxyAgent } from 'https-proxy-agent'; import type { HttpResolveConfig } from './config'; import type { UserContext } from './walk'; export { parseYaml, stringifyYaml } from './js-yaml'; export type StackFrame = { prev: StackFrame | null; value: T; }; export type Stack = StackFrame | null; export type StackNonEmpty = StackFrame; export declare function pushStack = Stack>(head: P, value: T): { prev: P; value: T; }; export declare function pluralize(sentence: string, count?: number, inclusive?: boolean): string; export declare function popStack>(head: P): StackFrame | null; export type BundleOutputFormat = 'json' | 'yml' | 'yaml'; export declare function loadYaml(filename: string): Promise; export declare function isDefined(x: T | undefined): x is T; export declare function isPlainObject(value: unknown): value is Record; export declare function isEmptyObject(value: unknown): value is Record; export declare function isNotEmptyObject(obj: unknown): boolean; export declare function isEmptyArray(value: unknown): boolean; export declare function isNotEmptyArray(args?: T[]): boolean; export declare function readFileFromUrl(url: string, config: HttpResolveConfig): Promise<{ body: any; mimeType: any; }>; export declare function pickObjectProps>(object: T, keys: Array): T; export declare function omitObjectProps>(object: T, keys: Array): T; export declare function splitCamelCaseIntoWords(str: string): Set; export declare function validateMimeType({ type, value }: any, { report, location }: UserContext, allowedValues: string[]): void; export declare function validateMimeTypeOAS3({ type, value }: any, { report, location }: UserContext, allowedValues: string[]): void; export declare function readFileAsStringSync(filePath: string): string; export declare function yamlAndJsonSyncReader(filePath: string): T; export declare function isPathParameter(pathSegment: string): boolean; /** * Convert Windows backslash paths to slash paths: foo\\bar ➔ foo/bar */ export declare function slash(path: string): string; export declare function isString(value: unknown): value is string; export declare function isNotString(value: string | T): value is T; export declare const assignConfig: (target: Record, obj?: Record) => void; export declare function assignOnlyExistingConfig(target: Record, obj?: Record): void; export declare function getMatchingStatusCodeRange(code: number | string): string; export declare function isCustomRuleId(id: string): boolean; export declare function doesYamlFileExist(filePath: string): boolean; export declare function showWarningForDeprecatedField(deprecatedField: string, updatedField?: string, updatedObject?: string, link?: string): void; export declare function showErrorForDeprecatedField(deprecatedField: string, updatedField?: string, updatedObject?: string): void; export type Falsy = undefined | null | false | '' | 0; export declare function isTruthy(value: Truthy | Falsy): value is Truthy; export declare function identity(value: T): T; export declare function keysOf(obj: T): (keyof T)[]; export declare function pickDefined>(obj?: T): Record | undefined; export declare function nextTick(): Promise; export declare function pause(ms: number): Promise; export declare function getProxyAgent(): HttpsProxyAgent | undefined; /** * Checks if two objects are deeply equal. * Borrowed the source code from https://github.com/lukeed/dequal. */ export declare function dequal(foo: any, bar: any): boolean; export type CollectFn = (value: unknown) => void; export type StrictObject = T & { [key: string]: undefined; };