export type NumberMode = number; export type PermissionRecord = { read?: boolean; write?: boolean; execute?: boolean; }; export type SpecialRecord = { setuid?: boolean; setgid?: boolean; sticky?: boolean; }; export type ObjectMode = { all?: PermissionRecord; user?: PermissionRecord; group?: PermissionRecord; others?: PermissionRecord; special?: SpecialRecord; }; type OctalDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7'; type OptionalOperator = '+' | '-' | '=' | ''; type OptionalLeading = '' | '0' | '00' | '0o' | '0O'; export type OctalMode = `${OptionalOperator}${OptionalLeading}${OctalDigit}${string}`; type RChar = 'r' | '-'; type WChar = 'w' | '-'; type XChar = 's' | 'S' | 't' | 'T' | 'x' | 'X' | '-'; export type FileType = 'd' | 'l' | 'p' | 's' | 'c' | 'b' | 'D' | '-'; type OptionalFileType = FileType | ''; export type StatMode = `${OptionalFileType}${RChar}${WChar}${XChar}${string}`; type WhoChar = 'u' | 'g' | 'o' | 'a'; export type SymbolicMode = `${WhoChar}${string}` | ''; export type ModeType = 'number' | 'object' | 'octal' | 'stat' | 'symbolic'; export type Mode = NumberMode | ObjectMode | OctalMode | StatMode | SymbolicMode; export {};