/** * TfType system – mirrors hfern/tf types.py, adapted for TypeScript. * * Every concrete type provides – * encode(value) → wire-safe representation (numbers, strings, plain objects) * decode(value) → JS-idiomatic representation * semanticallyEqual(a, b) → whether two decoded values represent the same state * tfType() → the JSON bytes Terraform expects for the `type` field in Schema.Attribute */ /** Sentinel for Terraform's "unknown at plan time" value. */ declare class _Unknown { toString(): string; } export declare const Unknown: _Unknown; export type UnknownType = typeof Unknown; export type TfValue = unknown; export interface TfType { encode(value: T | null | UnknownType): TfValue; decode(value: TfValue): T | null | UnknownType; semanticallyEqual(a: T | null | UnknownType, b: T | null | UnknownType): boolean; /** JSON bytes for the Terraform type descriptor (e.g. `"string"`, `["list","number"]`) */ tfType(): Uint8Array; } export declare class TfString implements TfType { encode(v: string | null | UnknownType): string | _Unknown | null; decode(v: TfValue): string | null | UnknownType; semanticallyEqual(a: TfValue, b: TfValue): boolean; tfType(): Buffer; } export declare class TfNumber implements TfType { encode(v: number | null | UnknownType): number | _Unknown | null; decode(v: TfValue): number | null | UnknownType; semanticallyEqual(a: TfValue, b: TfValue): boolean; tfType(): Buffer; } export declare class TfBool implements TfType { encode(v: boolean | null | UnknownType): boolean | _Unknown | null; decode(v: TfValue): boolean | null | UnknownType; semanticallyEqual(a: TfValue, b: TfValue): boolean; tfType(): Buffer; } /** * NormalizedJson – stored as a string but round-tripped through JSON.parse/stringify * with sorted keys so Terraform never sees a spurious diff from key reordering. */ export declare class TfNormalizedJson implements TfType { encode(v: unknown): TfValue; decode(v: TfValue): unknown; semanticallyEqual(a: TfValue, b: TfValue): boolean; tfType(): Buffer; } export declare class TfList implements TfType { readonly elementType: TfType; constructor(elementType: TfType); encode(v: T[] | null | UnknownType): TfValue; decode(v: TfValue): T[] | null | UnknownType; semanticallyEqual(a: T[] | null | UnknownType, b: T[] | null | UnknownType): boolean; tfType(): Buffer; } export declare class TfSet extends TfList { semanticallyEqual(a: T[] | null | UnknownType, b: T[] | null | UnknownType): boolean; tfType(): Buffer; } export declare class TfMap implements TfType> { readonly elementType: TfType; constructor(elementType: TfType); encode(v: Record | null | UnknownType): TfValue; decode(v: TfValue): Record | null | UnknownType; semanticallyEqual(a: Record | null | UnknownType, b: Record | null | UnknownType): boolean; tfType(): Buffer; } export declare const types: { readonly string: () => TfString; readonly number: () => TfNumber; readonly bool: () => TfBool; readonly normalizedJson: () => TfNormalizedJson; readonly list: (el: TfType) => TfList; readonly set: (el: TfType) => TfSet; readonly map: (el: TfType) => TfMap; }; export {}; //# sourceMappingURL=types.d.ts.map