@@ -32,30 +32,30 @@ import { Memory } from '../../system/memory/index.ts'
3232import { Guard } from '../../guard/index.ts'
3333import { type TSchema , type TObjectOptions , IsKind } from './schema.ts'
3434import { type StaticType , type StaticDirection } from './static.ts'
35-
3635import { type TProperties } from './properties.ts'
3736import { type TInteger , Integer , IntegerPattern } from './integer.ts'
38-
39- import { type TTemplateLiteral } from './template-literal.ts'
4037import { type TNumber , Number , NumberPattern } from './number.ts'
4138import { type TString , String , StringPattern } from './string.ts'
42-
4339import { type TDeferred , Deferred } from './deferred.ts'
40+
4441import { type TInstantiate , Instantiate } from '../engine/instantiate.ts'
42+ import { type TTemplateLiteralStatic } from '../engine/template-literal/index.ts'
4543import { CreateRecord } from '../engine/record/record-create.ts'
4644
4745// -------------------------------------------------------------------
4846// Static
4947// -------------------------------------------------------------------
48+ type StaticPropertyKey < Key extends string , Result extends PropertyKey = (
49+ Key extends TStringKey ? string :
50+ Key extends TIntegerKey ? number :
51+ Key extends TNumberKey ? number :
52+ Key extends `^${string } $` ? TTemplateLiteralStatic < Key > :
53+ string
54+ ) > = Result
5055export type StaticRecord < Stack extends string [ ] , Direction extends StaticDirection , Context extends TProperties , This extends TProperties , Key extends string , Value extends TSchema ,
56+ StaticKey extends PropertyKey = StaticPropertyKey < Key > ,
5157 StaticValue extends unknown = StaticType < Stack , Direction , Context , This , Value > ,
52- Result extends Record < PropertyKey , unknown > = (
53- Key extends TStringKey ? Record < string , StaticValue > :
54- Key extends TIntegerKey ? Record < number , StaticValue > :
55- Key extends TNumberKey ? Record < number , StaticValue > :
56- Record < string , StaticValue >
57- )
58- > = Result
58+ > = Record < StaticKey , StaticValue >
5959// -------------------------------------------------------------------
6060// Keys
6161// -------------------------------------------------------------------
0 commit comments