import { JsonObject, JsonValue } from "@codingame/monaco-vscode-github-service-override/vscode/vs/platform/github/common/client/types"; /** Indicates that a value does not match the expected schema. */ export declare class SchemaError extends Error { /** Creates a schema validation error with the supplied diagnostic message. */ constructor(message: string); } /** Composable parsers for validating API values and response shapes. */ export declare namespace parse { /** Parses a value without including it in validation errors. */ type Parser = (value: unknown) => T; /** Requires a parser for every declared property, including optional properties. */ type ObjectSchema = { [K in keyof T]-?: Parser; }; /** Reads a string, including the empty string. */ function string(value: unknown): string; /** Reads a non-empty string without trimming whitespace. */ function nonEmptyString(value: unknown): string; /** Reads a full lowercase hexadecimal Git SHA-1 or SHA-256 object ID. */ const sha: Parser; /** Reads an RFC 3339 date-time string without changing its representation. */ const dateTime: Parser; /** Reads a boolean without coercing other values. */ function boolean(value: unknown): boolean; /** Reads a finite JSON number, including fractional values. */ function finiteNumber(value: unknown): number; /** Reads a finite nonnegative number, including fractional values. */ function nonNegativeNumber(value: unknown): number; /** Reads a safe integer, including negative values. */ function integer(value: unknown): number; /** Builds a parser for safe integers within inclusive bounds. */ function range(min: number, max: number): Parser; /** Reads a nonnegative safe integer. */ const nonNegativeInteger: Parser; /** Reads a positive safe integer. */ const positiveInteger: Parser; /** Parses array elements, reusing the input unless an element changes. */ function arrayOf(parser: Parser): Parser; /** Reads an array containing only strings. */ const strings: Parser; /** Validates declared fields while retaining extra fields and reusing unchanged plain objects. */ function object(schema: ObjectSchema): Parser; /** Creates a fresh object containing only defined schema fields; nested values follow their own parsers. */ function copyObject(schema: ObjectSchema): Parser; /** Parses service-supplied own values, reusing unchanged plain objects. */ function dictionary(parser: Parser): Parser>; /** * Preserves opaque JSON payloads without interpreting event-specific fields. * Accepts only values that `JSON.parse` can produce and returns them without copying. */ function jsonValue(value: unknown): JsonValue; /** * Validates each property of a plain object as a JSON value and returns the object without copying. * Rejects objects with any other prototype, such as class instances, `Date` or `Map`. */ function jsonObject(value: unknown): JsonObject; /** Reads one exact string, numeric, or boolean literal. */ function exact(expected: T): Parser; /** Reads one of the declared string, numeric, or boolean literals. */ function oneOf(...values: readonly T[]): Parser; /** Adds a predicate constraint without changing the parsed value. */ function refine(parser: Parser, predicate: (value: T) => boolean, message: string): Parser; /** Merges amendments into a parsed object without mutating it, with amended fields taking precedence. */ function amend(parser: Parser, amendment: (value: T) => U): Parser & U>; /** Allows an omitted property without collapsing an explicit null. */ function optional(parser: Parser): Parser; /** Uses the supplied default only for an omitted property. */ function optional(parser: Parser, defaultValue: NoInfer): Parser; /** Allows an explicit null without accepting a missing property. */ function nullable(parser: Parser): Parser; }