Skip to content

Commit 5551342

Browse files
committed
fix: support isolatedDeclarations (WIP)
1 parent f724222 commit 5551342

File tree

26 files changed

+209
-188
lines changed

26 files changed

+209
-188
lines changed

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export default [
9797
'.eslintrc.cjs',
9898
'packages/*/index.js',
9999
'docsgen.config.js',
100+
'packages/format-explorer/vite.config.ts',
100101
'scripts/api/*.js'
101102
]
102103
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
"trash-cli": "^6.0.0",
153153
"tslib": "^2.6.2",
154154
"tsx": "^4.11.2",
155-
"typescript": "^5.5.3",
155+
"typescript": "^5.6.3",
156156
"typescript-eslint": "^8.4.0",
157157
"vitepress": "1.5.0",
158158
"vitest": "^2.1.5",

packages/core-base/src/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export interface CoreInternalContext {
333333
* Intlify core-base version
334334
* @internal
335335
*/
336-
export const VERSION = __VERSION__
336+
export const VERSION: string = __VERSION__
337337

338338
export const NOT_REOSLVED = -1
339339

packages/core-base/src/datetime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export function datetime<
295295
}
296296

297297
/** @internal */
298-
export const DATETIME_FORMAT_OPTIONS_KEYS = [
298+
export const DATETIME_FORMAT_OPTIONS_KEYS: string[] = [
299299
'localeMatcher',
300300
'weekday',
301301
'era',

packages/core-base/src/devtools.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@ export function initI18nDevTools(
3030
})
3131
}
3232

33-
export const translateDevTools =
33+
export const translateDevTools: ReturnType<typeof createDevToolsHook> =
3434
/* #__PURE__*/ createDevToolsHook('function:translate')
3535

36-
function createDevToolsHook(hook: IntlifyDevToolsHooks) {
36+
function createDevToolsHook(
37+
hook: IntlifyDevToolsHooks
38+
): (
39+
payloads: IntlifyDevToolsHookPayloads[IntlifyDevToolsHooks]
40+
) => void | null {
3741
return (payloads: IntlifyDevToolsHookPayloads[IntlifyDevToolsHooks]) =>
3842
devtools && devtools.emit(hook, payloads)
3943
}

packages/core-base/src/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { BaseError } from '@intlify/shared'
88
export interface CoreError extends BaseError {}
99

1010
export const CoreErrorCodes = {
11-
INVALID_ARGUMENT: COMPILE_ERROR_CODES_EXTEND_POINT, // 17
11+
INVALID_ARGUMENT: COMPILE_ERROR_CODES_EXTEND_POINT as number, // 17
1212
INVALID_DATE_ARGUMENT: 18,
1313
INVALID_ISO_DATE_ARGUMENT: 19,
1414
NOT_SUPPORT_NON_STRING_MESSAGE: 20,

packages/core-base/src/fallbacker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function getLocale<Messages, Message>(
3535
let _resolveLocale: string
3636

3737
/** @internal */
38-
export function resolveLocale(locale: Locale | LocaleDetector) {
38+
export function resolveLocale(locale: Locale | LocaleDetector): string {
3939
if (isString(locale)) {
4040
return locale
4141
} else {

packages/core-base/src/format.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export function formatMessagePart<Message = string>(
163163

164164
const PROPS_TYPE = ['t', 'type']
165165

166-
export function resolveType(node: Node) {
166+
export function resolveType(node: Node): ReturnType<typeof resolveProps> {
167167
return resolveProps<NodeTypes>(node, PROPS_TYPE)
168168
}
169169

packages/core-base/src/number.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export function number<
290290
}
291291

292292
/** @internal */
293-
export const NUMBER_FORMAT_OPTIONS_KEYS = [
293+
export const NUMBER_FORMAT_OPTIONS_KEYS: string[] = [
294294
'localeMatcher',
295295
'style',
296296
'currency',

packages/format-explorer/src/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,4 +241,4 @@ export default {
241241
'editorCursor.foreground': '#AEAFAD',
242242
'editorWhitespace.foreground': '#4B4E55'
243243
}
244-
}
244+
} as const

0 commit comments

Comments
 (0)