operator-checker
Version:
Iranian mobile operator detection package for Vue 3 and TypeScript
60 lines • 1.87 kB
TypeScript
import { Operator, type OperatorInfo } from './operator-checker';
export interface UseOperatorCheckerOptions {
/**
* Whether to automatically validate the phone number format
* @default true
*/
autoValidate?: boolean;
/**
* Whether to show detailed operator information
* @default false
*/
showDetails?: boolean;
}
export interface OperatorCheckerState {
phoneNumber: string;
operator: Operator | null;
operatorInfo: OperatorInfo | null;
operatorName: string | null;
operatorNameFa: string | null;
isValid: boolean;
isLoading: boolean;
error: string | null;
}
export declare function useOperatorChecker(options?: UseOperatorCheckerOptions): {
phoneNumber: import("vue").Ref<string, string>;
operator: import("vue").Ref<Operator, Operator>;
operatorInfo: import("vue").Ref<{
code: Operator;
name: string;
nameFa: string;
prefixes: string[];
}, OperatorInfo | {
code: Operator;
name: string;
nameFa: string;
prefixes: string[];
}>;
operatorName: import("vue").Ref<string, string>;
operatorNameFa: import("vue").Ref<string, string>;
isValid: import("vue").Ref<boolean, boolean>;
isLoading: import("vue").Ref<boolean, boolean>;
error: import("vue").Ref<string, string>;
operatorCode: import("vue").ComputedRef<Operator>;
operatorDetails: import("vue").ComputedRef<{
code: Operator;
name: string;
nameFa: string;
info: {
code: Operator;
name: string;
nameFa: string;
prefixes: string[];
};
}>;
checkOperator: (number: string) => void;
reset: () => void;
validateNumber: (number: string) => boolean;
Operator: typeof Operator;
};
//# sourceMappingURL=useOperatorChecker.d.ts.map