gnablib
Version:
A lean, zero dependency library to provide a useful base for your project.
45 lines (44 loc) • 1.9 kB
TypeScript
/*! Copyright 2023-2025 the gnablib contributors MPL-1.1 */
import { ColType } from './ColType.js';
import { ACudColType } from './ACudColType.js';
import type { IValid } from '../interfaces/IValid.js';
import { FromBinResult } from '../../primitive/FromBinResult.js';
import { IProblem } from '../../error/probs/interfaces/IProblem.js';
import { U64 } from '../../primitive/number/U64.js';
declare abstract class AId extends ACudColType implements IValid<number | U64> {
protected abstract get _maxByteLen(): number;
protected abstract get _max64(): U64;
constructor();
valid(input: number | U64 | undefined): IProblem | undefined;
cudByteSize(): number;
unknownBin(value: number | U64): Uint8Array;
binUnknown(bin: Uint8Array, pos: number): FromBinResult<U64>;
}
export declare class Id2 extends AId {
readonly _colType = ColType.Id2;
readonly _maxByteLen = 2;
readonly _max64: U64;
readonly mysqlType = "SMALLINT AUTO_INCREMENT PRIMARY KEY";
readonly sqliteType = "INT2 PRIMARY KEY NOT NULL";
readonly postgresType = "smallint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY";
readonly cudType = "id2";
}
export declare class Id4 extends AId {
readonly _colType = ColType.Id4;
readonly _maxByteLen = 4;
readonly _max64: U64;
readonly mysqlType = "INT AUTO_INCREMENT PRIMARY KEY";
readonly sqliteType = "INT PRIMARY KEY NOT NULL";
readonly postgresType = "int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY";
readonly cudType = "id4";
}
export declare class Id8 extends AId {
readonly _colType = ColType.Id8;
readonly _maxByteLen = 8;
readonly _max64: U64;
readonly mysqlType = "BIGINT AUTO_INCREMENT PRIMARY KEY";
readonly sqliteType = "BIGINT PRIMARY KEY NOT NULL";
readonly postgresType = "bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY";
readonly cudType = "id8";
}
export {};