Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
63 lines
1.8 KiB
Plaintext
63 lines
1.8 KiB
Plaintext
import type { ClientField, Operator, ResolvedFilterOptions, SanitizedCollectionConfig, Where } from 'payload';
|
|
export type WhereBuilderProps = {
|
|
readonly collectionPluralLabel: SanitizedCollectionConfig['labels']['plural'];
|
|
readonly collectionSlug: SanitizedCollectionConfig['slug'];
|
|
readonly fields?: ClientField[];
|
|
readonly renderedFilters?: Map<string, React.ReactNode>;
|
|
readonly resolvedFilterOptions?: Map<string, ResolvedFilterOptions>;
|
|
};
|
|
export type Value = Date | number | number[] | string | string[];
|
|
export type ReducedField = {
|
|
field: ClientField;
|
|
label: React.ReactNode;
|
|
operators: {
|
|
label: string;
|
|
value: Operator;
|
|
}[];
|
|
plainTextLabel?: string;
|
|
value: Value;
|
|
};
|
|
export type Relation = 'and' | 'or';
|
|
export type ADD = {
|
|
andIndex?: number;
|
|
field: string;
|
|
orIndex?: number;
|
|
relation?: Relation;
|
|
type: 'add';
|
|
};
|
|
export type REMOVE = {
|
|
andIndex: number;
|
|
orIndex: number;
|
|
type: 'remove';
|
|
};
|
|
export type UPDATE = {
|
|
andIndex: number;
|
|
field?: string;
|
|
operator?: string;
|
|
orIndex: number;
|
|
type: 'update';
|
|
value?: unknown;
|
|
};
|
|
export type Action = ADD | REMOVE | UPDATE;
|
|
export type State = {
|
|
or: Where[];
|
|
};
|
|
export type AddCondition = ({ andIndex, field, orIndex, relation, }: {
|
|
andIndex: number;
|
|
field: ReducedField;
|
|
orIndex: number;
|
|
relation: 'and' | 'or';
|
|
}) => Promise<void> | void;
|
|
export type UpdateCondition = ({ type, andIndex, field, operator, orIndex, value, }: {
|
|
andIndex: number;
|
|
field: ReducedField;
|
|
operator: string;
|
|
orIndex: number;
|
|
type: 'field' | 'operator' | 'value';
|
|
value: Value;
|
|
}) => Promise<void> | void;
|
|
export type RemoveCondition = ({ andIndex, orIndex, }: {
|
|
andIndex: number;
|
|
orIndex: number;
|
|
}) => Promise<void> | void;
|
|
//# sourceMappingURL=types.d.ts.map |