muschema
Version:
Schemas for mudb
31 lines (30 loc) • 1.35 kB
TypeScript
import { MuSchema } from './schema';
import { MuNumber } from './_number';
import { MuReadStream, MuWriteStream } from 'mustreams';
export declare type _MuVectorType<ValueSchema extends MuNumber> = {
float32: Float32Array;
float64: Float64Array;
int8: Int8Array;
int16: Int16Array;
int32: Int32Array;
uint8: Uint8Array;
uint16: Uint16Array;
uint32: Uint32Array;
}[ValueSchema['muType']];
export declare class MuVector<ValueSchema extends MuNumber> implements MuSchema<_MuVectorType<ValueSchema>> {
private _constructor;
private _pool;
readonly identity: _MuVectorType<ValueSchema>;
readonly muType: string;
readonly muData: ValueSchema;
readonly json: object;
readonly dimension: number;
constructor(valueSchema: ValueSchema, dimension: number);
alloc(): _MuVectorType<ValueSchema>;
free(vec: _MuVectorType<ValueSchema>): void;
equal(x: _MuVectorType<ValueSchema>, y: _MuVectorType<ValueSchema>): boolean;
clone(vec: _MuVectorType<ValueSchema>): _MuVectorType<ValueSchema>;
copy(source: _MuVectorType<ValueSchema>, target: _MuVectorType<ValueSchema>): void;
diff(base_: _MuVectorType<ValueSchema>, target_: _MuVectorType<ValueSchema>, stream: MuWriteStream): boolean;
patch(base: _MuVectorType<ValueSchema>, stream: MuReadStream): _MuVectorType<ValueSchema>;
}