autumn-js
Version:
Autumn JS Library
42 lines (39 loc) • 1.53 kB
text/typescript
import { A as AutumnPromise, a as CheckResult, R as Result } from '../response-dnzFyX91.mjs';
import { AttachParams } from '../client/types/clientAttachTypes.mjs';
import { CheckParams, CancelParams, TrackParams } from '../client/types/clientGenTypes.mjs';
import { AllowedParams } from './handleAllowed.mjs';
import * as swr from 'swr';
import { A as AutumnError } from '../error-DHbclCVh.mjs';
import { E as Entity } from '../entTypes-BVPtpycG.mjs';
import { GetEntityParams } from '../client/types/clientEntTypes.mjs';
import '../cusTypes-COIU0NG3.mjs';
import 'zod';
declare const useEntity: (entityId: string | null, params?: GetEntityParams) => {
entity: Entity | null;
isLoading: boolean;
error: any;
refetch: swr.KeyedMutator<Entity | null>;
allowed: (params: AllowedParams) => boolean;
check: (params: CheckParams) => AutumnPromise<CheckResult>;
attach: (params: AttachParams) => Promise<Result<CheckResult | {
code: string;
message: string;
customer_id: string;
product_ids: string[];
customer_data?: any;
checkout_url?: string | undefined;
}, AutumnError>>;
cancel: (params: CancelParams) => AutumnPromise<{
customer_id: string;
success: boolean;
product_id: string;
}>;
track: (params: TrackParams) => AutumnPromise<{
code: string;
id: string;
customer_id: string;
feature_id?: string | undefined;
event_name?: string | undefined;
}>;
};
export { useEntity };