import '../../../../assert/js/assert.js';
import '../../../../globals.js';
/**
 * Represents a data type that can be serialized/deserialized to/from a binary form, both in TypeScript and in WGSL.
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import { ByteEncoder, WGSLExpression, WGSLExpressionBool, WGSLExpressionI32, WGSLExpressionT, WGSLExpressionU32, WGSLStatements, WGSLType, WGSLVariableName } from '../../imports.js';
import Vector2 from '../../../../dot/js/Vector2.js';
import Vector3 from '../../../../dot/js/Vector3.js';
import Vector4 from '../../../../dot/js/Vector4.js';
export type WGSLBinaryStatements = (value: WGSLVariableName, a: WGSLExpression, b: WGSLExpression) => WGSLStatements;
export type StoreStatementCallback = (offset: WGSLExpressionU32, u32expr: WGSLExpressionU32) => WGSLStatements;
type ConcreteType<T = unknown> = {
    name: string;
    bytesPerElement: number;
    outOfRangeElement?: T;
    equals: (a: T, b: T) => boolean;
    equalsWGSL: (a: WGSLExpressionT, b: WGSLExpressionT) => WGSLExpressionBool;
    encode(value: T, encoder: ByteEncoder): void;
    decode(encoder: ByteEncoder, offset: number): T;
    valueType: WGSLType;
    writeU32s(storeStatement: StoreStatementCallback, value: WGSLExpression): WGSLStatements;
    wgslAlign: number;
    wgslSize: number;
    generateRandom(fullSize?: boolean): T;
    toDebugString(value: T): string;
};
export default ConcreteType;
export declare const U32_IDENTITY_VALUES: {
    readonly add: 0;
    readonly max: 0;
    readonly min: 4294967295;
    readonly and: 4294967295;
    readonly or: 0;
    readonly xor: 0;
};
export declare const I32_IDENTITY_VALUES: {
    readonly add: 0;
    readonly max: -2147483647;
    readonly min: 2147483647;
    readonly and: -1;
    readonly or: 0;
    readonly xor: 0;
};
export type ConcreteArrayType<T = unknown> = ConcreteType<T[]> & {
    elementType: ConcreteType<T>;
    length: number;
    slice(start: number, end: number): ConcreteArrayType<T>;
};
export type BinaryOp<T> = {
    name: string;
    type: ConcreteType<T>;
    isCommutative: boolean;
    identity: T;
    apply: (a: T, b: T) => T;
    identityWGSL: WGSLExpressionT;
    combineExpression?: (a: WGSLExpressionT, b: WGSLExpressionT) => WGSLExpressionT;
    combineStatements?: (varName: WGSLVariableName, a: WGSLExpressionT, b: WGSLExpressionT) => WGSLStatements;
    atomicName?: string;
};
export type BitOrder<T> = {
    name: string;
    type: ConcreteType<T>;
    getBits: (value: T, bitOffset: number, bitQuantity: number) => number;
    getBitsWGSL: (value: WGSLExpressionT, bitOffset: number, bitQuantity: number) => WGSLExpressionU32;
};
export type CompareOrder<T> = {
    name: string;
    type: ConcreteType<T>;
    compare: (a: T, b: T) => number;
    compareWGSL: (a: WGSLExpressionT, b: WGSLExpressionT) => WGSLExpressionI32;
    greaterThanWGSL: (a: WGSLExpressionT, b: WGSLExpressionT) => WGSLExpressionBool;
    lessThanOrEqualWGSL: (a: WGSLExpressionT, b: WGSLExpressionT) => WGSLExpressionBool;
};
export type Order<T> = BitOrder<T> & CompareOrder<T>;
export declare const getArrayType: <T>(type: ConcreteType<T>, size: number, outOfRangeElement?: T) => ConcreteArrayType<T>;
export declare const getVariableLengthArrayType: <T>(type: ConcreteType<T>, maxSize: number, outOfRangeElement?: T) => ConcreteArrayType<T>;
export declare const getCastedType: <T>(type: ConcreteType<T>, valueType: WGSLType) => ConcreteType<T>;
export declare const U32Type: ConcreteType<number>;
export declare const U32AtomicType: ConcreteType<number>;
export declare const U32Add: BinaryOp<number>;
export declare const U32Min: BinaryOp<number>;
export declare const U32Max: BinaryOp<number>;
export declare const U32And: BinaryOp<number>;
export declare const U32Or: BinaryOp<number>;
export declare const U32Xor: BinaryOp<number>;
export declare const U32Order: Order<number>;
export declare const U32ReverseOrder: Order<number>;
export declare const I32Type: ConcreteType<number>;
export declare const I32AtomicType: ConcreteType<number>;
export declare const I32Add: BinaryOp<number>;
export declare const I32Min: BinaryOp<number>;
export declare const I32Max: BinaryOp<number>;
export declare const I32And: BinaryOp<number>;
export declare const I32Or: BinaryOp<number>;
export declare const I32Xor: BinaryOp<number>;
export declare const I32Order: CompareOrder<number>;
export declare const F32Type: ConcreteType<number>;
export declare const F32Order: CompareOrder<number>;
export declare const Vec2uType: ConcreteType<Vector2>;
export declare const Vec2uAdd: BinaryOp<Vector2>;
export declare const Vec2uBic: BinaryOp<Vector2>;
export declare const Vec2uLexicographicalOrder: Order<Vector2>;
export declare const Vec3uType: ConcreteType<Vector3>;
export declare const Vec3uAdd: BinaryOp<Vector3>;
export declare const Vec4uType: ConcreteType<Vector4>;
export declare const Vec4uAdd: BinaryOp<Vector4>;
//# sourceMappingURL=ConcreteType.d.ts.map