/** * Pure compile-time type tests for ConfigOnChain and TransformNestedArtifacts * These tests don't require a test runner - they pass/fail at compile time */ import { Artifact, ArtifactOnChain, ConfigOnChain } from './artifact.js'; type Equals = (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 ? true : false; type AssertTrue = T; export type AssertFalse = T; interface TestConfig { setting: string; } interface TestDeployed { address: string; } interface RequiredArtifactConfig { art: Artifact; bar: string; } type RequiredResult = ConfigOnChain; type ExpectedRequired = { art: ArtifactOnChain; bar: string; }; export type _Test1 = AssertTrue>; interface OptionalArtifactConfig { art?: Artifact; bar: string; } type OptionalResult = ConfigOnChain; type ExpectedOptional = { art?: ArtifactOnChain; bar: string; }; export type _Test2 = AssertTrue>; interface ArrayConfig { artifacts: Artifact[]; name: string; } type ArrayResult = ConfigOnChain; type ExpectedArray = { artifacts: ArtifactOnChain[]; name: string; }; export type _Test3 = AssertTrue>; interface NestedRequiredConfig { domains: { domain1: Artifact; domain2: Artifact; }; owner: string; } type NestedRequiredResult = ConfigOnChain; type ExpectedNestedRequired = { domains: { domain1: ArtifactOnChain; domain2: ArtifactOnChain; }; owner: string; }; export type _Test4 = AssertTrue>; interface NestedOptionalConfig { fallbacks: { primary?: Artifact; secondary?: Artifact; }; enabled: boolean; } type NestedOptionalResult = ConfigOnChain; type ExpectedNestedOptional = { fallbacks: { primary?: ArtifactOnChain; secondary?: ArtifactOnChain; }; enabled: boolean; }; export type _Test5 = AssertTrue>; interface RecordConfig { type: 'routing'; domains: Record>; owner: string; } type RecordResult = ConfigOnChain; type ExpectedRecord = { type: 'routing'; domains: Record>; owner: string; }; export type _Test6 = AssertTrue>; interface RecordOptionalConfig { type: 'fallback'; domains: Record | undefined>; owner: string; } type RecordOptionalResult = ConfigOnChain; type ExpectedRecordOptional = { type: 'fallback'; domains: Record | undefined>; owner: string; }; export type _Test7 = AssertTrue>; interface MixedNestedConfig { mixed: { art: Artifact; bar: string; }; name: string; } type MixedNestedResult = ConfigOnChain; type ExpectedMixedNested = { mixed: { art: ArtifactOnChain; bar: string; }; name: string; }; export type _Test8 = AssertTrue>; interface OptionalMixedNestedConfig { mixed?: { art: Artifact; bar: string; }; name: string; } type OptionalMixedNestedResult = ConfigOnChain; type ExpectedOptionalMixedNested = { mixed?: { art: ArtifactOnChain; bar: string; }; name: string; }; export type _Test9 = AssertTrue>; interface MixedNestedOptionalArtifactConfig { mixed: { art?: Artifact; bar: string; }; name: string; } type MixedNestedOptionalArtifactResult = ConfigOnChain; type ExpectedMixedNestedOptionalArtifact = { mixed: { art?: ArtifactOnChain; bar: string; }; name: string; }; export type _Test10 = AssertTrue>; interface PrimitivesConfig { str: string; num: number; bool: boolean; nullable: string | null; optional?: number; } type PrimitivesResult = ConfigOnChain; type ExpectedPrimitives = { str: string; num: number; bool: boolean; nullable: string | null; optional?: number; }; export type _Test11 = AssertTrue>; interface StrictRequiredConfig { required: Artifact; } type _StrictRequiredResult = ConfigOnChain; type _CorrectRequired = { required: ArtifactOnChain; }; export type _Test12 = AssertTrue>; export {}; //# sourceMappingURL=artifact.types.test.d.ts.map