zexson_toolkit
Version:
Zexson Toolkit is a powerful encryption and tokenization library developed by Zexson Team. It offers proprietary encryption algorithms, high-security random token generation, and advanced object comparison features. It includes many advanced security func
52 lines (51 loc) • 2.18 kB
TypeScript
export type CharacterSetType = 'defaultSet' | 'number' | 'alpha' | 'symbols';
export type tokenGeneratorType = (length: number, charSet: string | undefined) => string;
export type encryptType = (data: string, options?: {
key?: string;
}) => string | undefined;
export type decryptType = (data: string, options?: {
key?: string;
} | undefined) => string;
export type base64EncodeType = (data: string, key?: string) => string;
export type base64DecodeType = (data: string, key?: string) => string;
export type IsEqualOptions = {
caseSensitive?: boolean;
key?: string;
log?: boolean;
};
export type isEqualType = (text: string, text1: string, options?: IsEqualOptions | undefined) => {
isEqual: boolean;
method?: string;
};
export type cryptObject = <T extends Record<string, any>>(data: T, key?: string) => T;
export type FieldDecoratorType = () => PropertyDecorator;
export type getFieldMetadataType = <T>(target: Record<string, any>) => {
[key: string]: T;
};
export type EncryptableObject = Record<string, unknown>;
export type EncryptBodyFunction = (object: EncryptableObject, secretKey?: string) => EncryptableObject;
export type DecryptBodyFunction = <T extends Record<string, any>>(object: EncryptableObject, secretKey?: string) => T;
export type PrimitiveType = 'string' | 'number' | 'boolean' | 'array' | 'object';
export interface SchemaObjectType {
type: PrimitiveType;
enum?: any[];
items?: SchemaDefinition;
properties?: Record<string, SchemaDefinition>;
}
export type SchemaDefinition = PrimitiveType | any[] | SchemaObjectType;
export interface CompareOptions {
checkType?: boolean;
schema?: Record<string, SchemaDefinition>;
}
export type IsEqualsObjectFunction = <T extends Record<string, any>>(obj1: T, obj2?: T, options?: CompareOptions) => boolean;
export type SchemaType = Record<string, SchemaDefinition>;
declare global {
namespace Express {
interface Request {
isCsrf: () => true | undefined;
createCsrf: (charSet?: string) => string;
deleteCsrf: () => true | undefined;
}
}
}
export {};