Skip to content

Commit

Permalink
chore: add more type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Apr 25, 2024
1 parent 404aae7 commit ba0614b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/commands/build.ts
Expand Up @@ -137,9 +137,9 @@ async function writeTypes(distDir: string, meta: ModuleMeta) {
)
const isStub = moduleTypes.includes('export *')

const appShims = []
const schemaShims = []
const moduleImports = []
const appShims: string[] = []
const schemaShims: string[] = []
const moduleImports: string[] = []

const hasTypeExport = (name: string) => isStub || typeExports.find(exp => exp.names.includes(name))

Expand All @@ -154,7 +154,7 @@ async function writeTypes(distDir: string, meta: ModuleMeta) {
}

if (hasTypeExport('ModuleRuntimeHooks')) {
const runtimeHooksInterfaces = []
const runtimeHooksInterfaces: string[] = []

if (hasTypeExport('ModuleRuntimeHooks')) {
runtimeHooksInterfaces.push('ModuleRuntimeHooks')
Expand Down Expand Up @@ -184,7 +184,7 @@ ${typeExports[0] ? `\nexport type { ${typeExports[0].names.join(', ')} } from '.

await fsp.writeFile(dtsFile, dtsContents, 'utf8')
if (!existsSync(dtsFileMts)) {
await fsp.writeFile(dtsFileMts, dtsContents.replaceAll('./module', './module.js'), 'utf8')
await fsp.writeFile(dtsFileMts, dtsContents.replace(/\.\/module/g, './module.js'), 'utf8')
}
}

Expand Down

0 comments on commit ba0614b

Please sign in to comment.