import type * as Schema from '../../../schema'; import type * as UID from '../../../uid'; import type { Guard } from '../../../utils'; /** * Wildcard notation for the fields. * * When used, it represents every non-populatable field from the given schema */ export type WildcardNotation = '*'; /** * Single non-populatable attribute representation * * @example * type A = 'title'; // ✅ * type B = 'description'; // ✅ * type C = 'populatableField'; // ❌ * type D = ''; // ❌ */ export type SingleAttribute = 'id' | 'documentId' | Guard.Never, string>; /** * Union of all possible string representation for fields * * @example * type A = 'title'; // ✅ * type B = 'title,description'; // ✅ * type C = 'id'; // ✅ * type D = '*'; // ✅ * type E = 'populatableField'; // ❌ * type F = ''; // ❌ */ export type StringNotation = WildcardNotation | SingleAttribute | `${string},${string}`; /** * Array notation for fields * * @example * type A = ['title']; // ✅ * type B = ['title', 'description']; // ✅ * type C = ['id']; // ✅ * type E = ['*']; // ❌ * type F = ['populatableField']; // ❌ * type G = ['']; // ❌ */ export type ArrayNotation = Exclude, WildcardNotation>[]; /** * Represents any notation for a sort (string, array, object) * * @example * type A = '*'; // ✅ * type B = 'id'; // ✅ * type C = 'title'; // ✅ * type D = 'title,description'; // ✅ * type E = ['title', 'description']; // ✅ * type F = [id, 'title,description']; // ✅ * type G = ['*']; // ❌ * type H = ['populatableField']; // ❌ * type I = ['']; // ❌ * type J = 'populatableField'; // ❌ * type K = ''; // ❌ */ export type Any = StringNotation | ArrayNotation; //# sourceMappingURL=fields.d.ts.map