Skip to content

Commit fa2c24a

Browse files
committed
inline stub id type
1 parent a8a9b6a commit fa2c24a

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

src/cli/codegen/registry.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,27 +64,29 @@ export function generateStubTypes(outputDirectory: string) {
6464
const typesDirectory = createTypesDirectory(outputDirectory)
6565
const registryStub = resolve(typesDirectory, 'index.d.ts')
6666

67+
const stubIdType = '`${string}:${string}`'
68+
6769
writeFileSync(
6870
registryStub,
6971
format(
7072
`
71-
import { NormalizedId } from '@pssbletrngle/data-modifier'
72-
7373
declare module '@pssbletrngle/data-modifier/generated' {
74-
export type RegistryId = NormalizedId
74+
type StubId = ${stubIdType}
75+
76+
export type RegistryId = StubId
7577
7678
// eslint-disable-next-line @typescript-eslint/no-unused-vars
77-
export type InferIds<T extends RegistryId> = NormalizedId
79+
export type InferIds<T extends RegistryId> = StubId
7880
79-
export type ItemId = NormalizedId
81+
export type ItemId = StubId
8082
81-
export type BlockId = NormalizedId
83+
export type BlockId = StubId
8284
83-
export type FluidId = NormalizedId
85+
export type FluidId = StubId
8486
85-
export type RecipeSerializerId = NormalizedId
87+
export type RecipeSerializerId = StubId
8688
87-
export type EntityTypeId = NormalizedId
89+
export type EntityTypeId = StubId
8890
}`,
8991
{ parser: 'typescript' }
9092
)

0 commit comments

Comments
 (0)