///
export interface PushData {
contract?: string;
amount?: number;
decimals?: number;
inviterRoles?: string[];
comparison?: string;
url?: string;
token?: string;
tokenId?: number;
}
export interface GuildData {
id: string;
role: string;
comparison: string;
}
export type Data = PushData | GuildData;
export interface Rule {
type: string;
category: string;
subcategory: string;
data: Data;
}
export type Condition = Rule | AnyCondition | AllCondition;
export interface AnyCondition {
any: Condition[];
}
export interface AllCondition {
all: Condition[];
}
export interface ChatConditions {
conditions: AllCondition | AnyCondition;
}
export interface TokenGatedRule {
chat: ChatConditions;
entry: ChatConditions;
}
export type ConditionType = 'any' | 'all';
export interface CriteriaStateType {
entryRootCondition: ConditionType;
setEntryRootCondition: React.Dispatch>;
entryRuleTypeCondition: ConditionType;
setEntryRuleTypeCondition: React.Dispatch>;
entryOptionTypeArray: ConditionType[];
setEntryOptionTypeArray: React.Dispatch>;
entryOptionsDataArray: Rule[][];
setEntryOptionsDataArray: React.Dispatch>;
selectedCriteria: number;
setSelectedCriteria: React.Dispatch>;
selectedRules: Rule[];
setSelectedRule: React.Dispatch>;
addNewCondtion: () => void;
addNewRule: (newRule: Rule) => boolean;
deleteRule: (idx: number) => void;
deleteEntryOptionsDataArray: (idx: number) => void;
selectEntryOptionsDataArrayForUpdate: (idx: number) => void;
entryOptionsDataArrayUpdate: number;
isCondtionUpdateEnabled: () => boolean;
updateCondition: () => void;
updateCriteriaIdx: number;
setUpdateCriteriaIdx: React.Dispatch>;
isUpdateCriteriaEnabled: () => boolean;
}
export type CriteriaValidationErrorType = {
guildId?: string;
guildComparison?: string;
guildRole?: string;
groupName?: string;
groupDescription?: string;
tokenError?: string;
tokenAmount?: string;
tokenId?: string;
url?: string;
};