import { CB, DynamicValue, Failure, Maybe, Nullable, OneOrMoreOf, ValueOf } from "vest-utils"; import { IsolateKey, RegistryIndex, RuntimeEvents, TIsolate, TIsolateFocused } from "vestjs-runtime"; import { StandardSchemaV1 } from "vest-utils/standardSchemaSpec"; //#region src/hooks/optional/OptionalTypes.d.ts type OptionalFields = Record; type OptionalsInput = OneOrMoreOf | OptionalsObject; type OptionalsObject = Record; type ImmediateOptionalFieldDeclaration = { type: OptionalFieldTypes.CUSTOM_LOGIC; rule: TOptionalRule; applied: boolean; }; type DelayedOptionalFieldDeclaration = { type: OptionalFieldTypes.AUTO; applied: boolean; rule: null; }; type TOptionalRule = DynamicValue; type OptionalFieldDeclaration = ImmediateOptionalFieldDeclaration | DelayedOptionalFieldDeclaration; declare enum OptionalFieldTypes { CUSTOM_LOGIC = 0, AUTO = 1, } //#endregion //#region src/suiteResult/Severity.d.ts declare enum Severity { WARNINGS = "warnings", ERRORS = "errors", } declare enum TestSeverity { Error = "error", Warning = "warning", } //#endregion //#region src/core/StateMachines/IsolateTestStateMachine.d.ts declare const TestStatus: { CANCELED: string; FAILED: string; OMITTED: string; PASSING: string; SKIPPED: string; STARTED: string; UNTESTED: string; WARNING: string; }; type TestStatus = ValueOf; //#endregion //#region src/core/test/TestTypes.d.ts type TestFnPayload = { signal: AbortSignal; }; type TestFn = (payload: TestFnPayload) => TestResult; type AsyncTest = Promise; type TestResult = Maybe | void; type TestMessage = string | undefined; type WithFieldName = { fieldName: F; }; //#endregion //#region src/core/isolate/IsolateTest/IsolateTest.d.ts type TIsolateTest = TIsolate & IsolateTestPayload>; type IsolateTestPayload = CommonTestFields & { severity: TestSeverity; testStatus: TestStatus; asyncTest?: AsyncTest; }; type CommonTestFields = { message?: Maybe; fieldName: F; testFn: TestFn; }; //#endregion //#region src/suiteResult/SummaryFailure.d.ts declare class SummaryFailure implements WithFieldName { fieldName: F; message: string | undefined; groupName: G | undefined; constructor(fieldName: F, message: string | undefined, groupName: G | undefined); static fromTestObject(testObject: TIsolateTest): SummaryFailure; } //#endregion //#region src/suiteResult/selectors/suiteSelectors.d.ts type InputFieldName = F; type InputGroupName = G; declare function suiteSelectors(summary: SuiteSummary): SuiteSelectors; interface SuiteSelectors { getWarning(): SummaryFailure | undefined; getWarning(fieldName: InputFieldName): string | undefined; getWarning(fieldName?: InputFieldName): SummaryFailure | string | undefined; getError(): SummaryFailure | undefined; getError(fieldName: InputFieldName): string | undefined; getError(fieldName?: InputFieldName): SummaryFailure | string | undefined; getMessage(fieldName: InputFieldName): string | undefined; getErrors(): FailureMessages; getErrors(fieldName: InputFieldName): string[]; getErrors(fieldName?: InputFieldName): string[] | FailureMessages; getWarnings(): FailureMessages; getWarnings(fieldName: InputFieldName): string[]; getWarnings(fieldName?: InputFieldName): string[] | FailureMessages; getErrorsByGroup(groupName: InputGroupName): FailureMessages; getErrorsByGroup(groupName: InputGroupName, fieldName: InputFieldName): string[]; getErrorsByGroup(groupName: InputGroupName, fieldName?: InputFieldName): string[] | FailureMessages; getWarningsByGroup(groupName: InputGroupName): FailureMessages; getWarningsByGroup(groupName: InputGroupName, fieldName: InputFieldName): string[]; getWarningsByGroup(groupName: InputGroupName, fieldName?: InputFieldName): string[] | FailureMessages; hasErrors(fieldName?: InputFieldName): boolean; hasWarnings(fieldName?: InputFieldName): boolean; hasErrorsByGroup(groupName: InputGroupName, fieldName?: InputFieldName): boolean; hasWarningsByGroup(groupName: InputGroupName, fieldName?: InputFieldName): boolean; isTested(fieldName: InputFieldName): boolean; isPending(fieldName?: InputFieldName): boolean; isValid(fieldName?: InputFieldName): boolean; isValidByGroup(groupName: InputGroupName, fieldName?: InputFieldName): boolean; } //#endregion //#region src/core/VestBus/BusEvents.d.ts type Events = { TEST_RUN_STARTED: void; TEST_COMPLETED: TIsolate; ALL_RUNNING_TESTS_FINISHED: void; REMOVE_FIELD: TFieldName; RESET_FIELD: TFieldName; RESET_SUITE: void; SUITE_RUN_STARTED: void; SUITE_CALLBACK_RUN_FINISHED: void; DONE_TEST_OMISSION_PASS: void; INITIALIZING_CALLBACKS: void; DEFER_THROW: Failure; }; //#endregion //#region src/core/VestBus/VestBus.d.ts type VestEvents = Events & RuntimeEvents; type Subscribe = { (event: T$1, cb: (payload: VestEvents[T$1]) => void): CB; (cb: CB): CB; }; //#endregion //#region src/hooks/focused/focused.d.ts type FieldExclusion = Maybe>; /** * Adds a field or a list of fields into the inclusion list * * @example * * only('username'); */ declare function only(match: FieldExclusion | false): TIsolateFocused | undefined; /** * Adds a field or a list of fields into the exclusion list * * @example * * skip('username'); */ declare function skip(match: FieldExclusion | boolean): TIsolateFocused | undefined; //#endregion //#region src/suite/getTypedMethods.d.ts type TTypedMethods = { include: (fieldName: F) => { when: (condition: F | TDraftCondition) => void; }; omitWhen: (conditional: TDraftCondition, callback: CB) => void; only: { (item: FieldExclusion): void; }; optional: (optionals: OptionalsInput) => void; skip: { (item: FieldExclusion): void; }; skipWhen: (condition: TDraftCondition, callback: CB) => void; test: { (fieldName: F, message: TestMessage, cb: TestFn): TIsolateTest; (fieldName: F, cb: TestFn): TIsolateTest; (fieldName: F, message: TestMessage, cb: TestFn, key: IsolateKey): TIsolateTest; (fieldName: F, cb: TestFn, key: IsolateKey): TIsolateTest; }; group: { (callback: () => void): TIsolate; (groupName: G, callback: () => void): TIsolate; }; }; type TDraftCondition = DynamicValue]>; //#endregion //#region src/suite/SuiteTypes.d.ts type SuiteCallbackWithSchema = S extends undefined ? T$1 : (data: InferSchemaOutput, ...args: any[]) => void; type Suite = SuiteMethods & StandardSchemaV1, InferSchemaData>; type SuiteMethods = { dump: CB; get: CB>; resume: CB; reset: CB; remove: CB; resetField: CB; run: (...args: S extends undefined ? Parameters : [data: InferSchemaData, ...args: any[]]) => SuiteResult; runStatic: (...args: S extends undefined ? Parameters : [data: InferSchemaData, ...args: any[]]) => SuiteResult; validate: (...args: S extends undefined ? Parameters : [data: InferSchemaData, ...args: any[]]) => SuiteResult; subscribe: Subscribe; } & AfterMethods & TTypedMethods & SuiteSelectors; type FocusedMethods = { afterEach: CB, [callback: CB]>; afterField: CB, [fieldName: F, callback: CB]>; focus: CB, [config: SuiteModifiers]>; only: CB, [onlyField: FieldExclusion]>; run: (...args: S extends undefined ? Parameters : [data: Partial>, ...args: any[]]) => SuiteResult; }; type AfterMethods = { afterEach: CB, [callback: CB]>; afterField: CB, [fieldName: F, callback: CB]>; focus: CB, [config: SuiteModifiers]>; only: CB, [onlyField: FieldExclusion]>; run: (...args: S extends undefined ? Parameters : [data: InferSchemaData, ...args: any[]]) => SuiteResult; }; /** * Modifiers that control which fields and groups are included or excluded * during a focused suite run. These can be provided either via * `suite.focus(modifiers)` or via shorthand methods: * - `suite.only(field)` is a shortcut for `suite.focus({ only: field })` * * - `only` — Run only the specified field(s). All others are excluded unless * explicitly included via `include()`. * - `skip` — Skip the specified field(s). All others run as usual. * - `skipGroup` — Skip all tests inside the named group(s). Tests outside the * matched groups are unaffected. * - `onlyGroup` — Run only tests inside the named group(s). Top-level tests * outside any group are also excluded. */ type SuiteModifiers = { only?: FieldExclusion; onlyGroup?: G | G[]; skip?: FieldExclusion; skipGroup?: G | G[]; }; //#endregion //#region src/suiteResult/SuiteResultTypes.d.ts declare class SummaryBase { errorCount: number; warnCount: number; testCount: number; pendingCount: number; } declare class SuiteSummary extends SummaryBase { [Severity.ERRORS]: SummaryFailure[]; [Severity.WARNINGS]: SummaryFailure[]; groups: Groups; tests: Tests; run: { data: { raw: D | undefined; parsed: Partial> | undefined; }; time: Date; focus?: SuiteModifiers; }; valid: Nullable; constructor(); } type Groups = { [key in G]: Group }; type Group = { [key in F]: SingleTestSummary } & ValidProperty; type Tests = { [key in F]: SingleTestSummary }; type SingleTestSummary = SummaryBase & CommonSummaryProperties & ValidProperty; type ValidProperty = { valid: Nullable; }; type CommonSummaryProperties = SummaryBase & { errors: string[]; warnings: string[]; }; type FailureMessages = Record; type TSchema = any; type InferSchemaData = S extends { '~standard': { types: { input: infer I; }; }; } ? I : S extends { infer: infer T; } ? { [K in keyof T]: T[K] } & NonNullable : any; type InferSchemaOutput = S extends { '~standard': { types: { output: infer O; }; }; } ? O : S extends { infer: infer T; } ? { [K in keyof T]: T[K] } & NonNullable : any; type SuiteResultData = (Omit, 'valid'> & SuiteSelectors & { valid: true; value: InferSchemaOutput; issues?: undefined; }) | (Omit, 'valid'> & SuiteSelectors & { valid: false; issues: ReadonlyArray; value?: undefined; }) | (Omit, 'valid'> & SuiteSelectors & { valid: null; issues?: undefined; value?: undefined; }); type BrandedFieldName = F & TFieldName; type BrandedGroupName = G & TGroupName; type SuiteResult = SuiteResultData, BrandedGroupName, S, D> & { dump: CB; types: S extends undefined ? undefined : { input: InferSchemaData; output: InferSchemaOutput; }; }; type TFieldName = string; type TGroupName = string; //#endregion //#region src/core/isolate/VestIsolateType.d.ts type TVestIsolate

= TIsolate

; //#endregion //#region src/core/isolate/IsolateSuite/IsolateSuite.d.ts type TIsolateSuite = TVestIsolate<{ optional: OptionalFields; resolver: CB>; registry_all?: RegistryIndex; registry_failed?: RegistryIndex; registry_omitted?: RegistryIndex; registry_passing?: RegistryIndex; registry_pending?: RegistryIndex; registry_tested?: RegistryIndex; registry_valid?: RegistryIndex; registry_warning?: RegistryIndex; }>; //#endregion export { TestMessage as _, SuiteSummary as a, TSchema as c, TDraftCondition as d, only as f, TestFn as g, TIsolateTest as h, SuiteResult as i, Suite as l, suiteSelectors as m, TVestIsolate as n, TFieldName as o, skip as p, InferSchemaOutput as r, TGroupName as s, TIsolateSuite as t, SuiteCallbackWithSchema as u, OptionalsInput as v }; //# sourceMappingURL=IsolateSuite-D5Qr0Oyg.d.mts.map