UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

34 lines • 1.79 kB
import { IOResult, type ByteSource } from '../../../io/types.ts'; import { LineFacts, type FileStat, type PathSpec } from '../../../types.ts'; import type { CommandFnResult, Context } from '../../config.ts'; import type { FlagValue } from '../../spec/types.ts'; import { FlagView } from '../../spec/flag_view.ts'; import type { JsonValue } from '../../../types.ts'; export interface UniqFlags { count: boolean; duplicatesOnly: boolean; uniqueOnly: boolean; typed: [string, string][]; ignoreCase: boolean; allRepeated: 'none' | 'prepend' | 'separate' | null; group: 'separate' | 'prepend' | 'append' | 'both' | null; zeroTerminated: boolean; } /** * uniq's options, its counts and operands refused by the engine in the order * typed, before any operand is read: the flags, or uniq's refusal. The flags * carry each operand's glob spread over its matches. Mirrors Python's * `uniq_flags`. */ export declare function uniqFlags(bag: Record<string, FlagValue>, operands?: readonly string[]): UniqFlags | IOResult; /** The uniq engine's config, the counts and operands as typed. Mirrors Python's * `engine_config`. */ export declare function engineConfig(parsed: UniqFlags): Record<string, JsonValue>; export declare function uniqGeneric(parsed: UniqFlags, paths: PathSpec[], ctx: Context, stream: (p: PathSpec) => AsyncIterable<Uint8Array>, write?: (p: PathSpec, data: ByteSource) => Promise<void>, stat?: (p: PathSpec) => Promise<FileStat>): Promise<CommandFnResult>; /** * A uniq line writes its second operand, which a pattern the backend * expands may name too; a quoted name is no pattern. Mirrors Python's * `facts`. */ export declare function facts(fl: FlagView, operands: readonly (string | PathSpec)[]): LineFacts; //# sourceMappingURL=uniq.d.ts.map