node-seal
Version:
Homomorphic Encryption for TypeScript or JavaScript using Microsoft SEAL
27 lines (26 loc) • 1.16 kB
TypeScript
import { Exception } from './exception';
import { Instance, LoaderOptions } from './seal';
export interface VectorDependencyOptions {
readonly Exception: Exception;
}
export interface VectorDependencies {
({ Exception }: VectorDependencyOptions): VectorConstructorOptions;
}
export interface VectorConstructorOptions {
(): Vector;
}
export interface Vector {
readonly instance: Instance;
readonly unsafeInject: (instance: Instance) => void;
readonly delete: () => void;
readonly from: (array: VectorTypes, type?: StringTypes) => Instance;
readonly type: string;
readonly setType: (type: StringTypes) => void;
readonly size: number;
readonly getValue: (index: number) => number;
readonly resize: (size: number, fill: number) => void;
readonly toArray: () => VectorTypes;
}
export type VectorTypes = Uint8Array | Int32Array | Uint32Array | Float64Array | BigInt64Array | BigUint64Array;
export type StringTypes = 'Uint8Array' | 'Int32Array' | 'Uint32Array' | 'Float64Array' | 'BigInt64Array' | 'BigUint64Array' | 'Modulus';
export declare const VectorInit: ({ loader }: LoaderOptions) => VectorDependencies;