Files
NapCatQQ/.pnpm-store/v3/files/51/1450a00cb5d85984dfcf6c35324559dd07e77388b37603d8167c10d978964f740126142d1f967836c94db7ac9b1ee587ea385b2f8e8de31a242fdbe23ad700
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

29 lines
3.3 KiB
Plaintext

export type TSetIncludes<T extends PropertyKey[], S extends PropertyKey> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? S extends L ? true : TSetIncludes<R, S> : false);
/** Returns true if element right is in the set of left */
export declare function SetIncludes<T extends PropertyKey[], S extends PropertyKey>(T: [...T], S: S): TSetIncludes<T, S>;
export type TSetIsSubset<T extends PropertyKey[], S extends PropertyKey[]> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetIsSubset<R, S> : false : true);
/** Returns true if left is a subset of right */
export declare function SetIsSubset<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetIsSubset<T, S>;
export type TSetDistinct<T extends PropertyKey[], Acc extends PropertyKey[] = []> = T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<Acc, L> extends false ? TSetDistinct<R, [...Acc, L]> : TSetDistinct<R, [...Acc]> : Acc;
/** Returns a distinct set of elements */
export declare function SetDistinct<T extends PropertyKey[]>(T: [...T]): TSetDistinct<T>;
export type TSetIntersect<T extends PropertyKey[], S extends PropertyKey[], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetIntersect<R, S, [...Acc, L]> : TSetIntersect<R, S, [...Acc]> : Acc);
/** Returns the Intersect of the given sets */
export declare function SetIntersect<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetIntersect<T, S>;
export type TSetUnion<T extends PropertyKey[], S extends PropertyKey[]> = ([
...T,
...S
]);
/** Returns the Union of the given sets */
export declare function SetUnion<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetUnion<T, S>;
export type TSetComplement<T extends PropertyKey[], S extends PropertyKey[], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetComplement<R, S, [...Acc]> : TSetComplement<R, S, [...Acc, L]> : Acc);
/** Returns the Complement by omitting elements in T that are in S */
export declare function SetComplement<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetComplement<T, S>;
type TSetIntersectManyResolve<T extends PropertyKey[][], Acc extends PropertyKey[]> = (T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetIntersectManyResolve<R, TSetIntersect<Acc, L>> : Acc);
export type TSetIntersectMany<T extends PropertyKey[][]> = (T extends [infer L extends PropertyKey[]] ? L : T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetIntersectManyResolve<R, L> : []);
export declare function SetIntersectMany<T extends PropertyKey[][]>(T: [...T]): TSetIntersectMany<T>;
export type TSetUnionMany<T extends PropertyKey[][], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetUnionMany<R, TSetUnion<Acc, L>> : Acc);
/** Returns the Union of multiple sets */
export declare function SetUnionMany<T extends PropertyKey[][]>(T: [...T]): TSetUnionMany<T>;
export {};