Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: petite-vue-i18n type errors #1945

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 29 additions & 30 deletions packages/petite-vue-i18n/src/vue.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { Path, NamedValue } from '@intlify/core-base'
import type { NamedValue, JsonPaths } from '@intlify/core-base'
import type {
TranslateOptions,
IsNever,
IsEmptyObject,
PickupPaths
IsEmptyObject
} from '@intlify/core-base'
import type { CustomBlocks } from '../../vue-i18n-core/src/composer'
import type {
Expand Down Expand Up @@ -80,13 +79,13 @@ declare module 'vue' {
DefinedLocaleMessage extends
RemovedIndexResources<DefineLocaleMessage> = RemovedIndexResources<DefineLocaleMessage>,
Keys = IsEmptyObject<DefinedLocaleMessage> extends false
? PickupPaths<{
? JsonPaths<{
[K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]
}>
: never,
ResourceKeys extends Keys = IsNever<Keys> extends false ? Keys : never
>(
key: Key | ResourceKeys | Path
key: Key | ResourceKeys
): TranslateResult
/**
* Locale message translation
Expand All @@ -104,13 +103,13 @@ declare module 'vue' {
DefinedLocaleMessage extends
RemovedIndexResources<DefineLocaleMessage> = RemovedIndexResources<DefineLocaleMessage>,
Keys = IsEmptyObject<DefinedLocaleMessage> extends false
? PickupPaths<{
? JsonPaths<{
[K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]
}>
: never,
ResourceKeys extends Keys = IsNever<Keys> extends false ? Keys : never
>(
key: Key | ResourceKeys | Path,
key: Key | ResourceKeys,
plural: number
): TranslateResult
/**
Expand All @@ -130,13 +129,13 @@ declare module 'vue' {
DefinedLocaleMessage extends
RemovedIndexResources<DefineLocaleMessage> = RemovedIndexResources<DefineLocaleMessage>,
Keys = IsEmptyObject<DefinedLocaleMessage> extends false
? PickupPaths<{
? JsonPaths<{
[K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]
}>
: never,
ResourceKeys extends Keys = IsNever<Keys> extends false ? Keys : never
>(
key: Key | ResourceKeys | Path,
key: Key | ResourceKeys,
plural: number,
options: TranslateOptions
): TranslateResult
Expand All @@ -156,13 +155,13 @@ declare module 'vue' {
DefinedLocaleMessage extends
RemovedIndexResources<DefineLocaleMessage> = RemovedIndexResources<DefineLocaleMessage>,
Keys = IsEmptyObject<DefinedLocaleMessage> extends false
? PickupPaths<{
? JsonPaths<{
[K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]
}>
: never,
ResourceKeys extends Keys = IsNever<Keys> extends false ? Keys : never
>(
key: Key | ResourceKeys | Path,
key: Key | ResourceKeys,
defaultMsg: string
): TranslateResult
/**
Expand All @@ -182,13 +181,13 @@ declare module 'vue' {
DefinedLocaleMessage extends
RemovedIndexResources<DefineLocaleMessage> = RemovedIndexResources<DefineLocaleMessage>,
Keys = IsEmptyObject<DefinedLocaleMessage> extends false
? PickupPaths<{
? JsonPaths<{
[K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]
}>
: never,
ResourceKeys extends Keys = IsNever<Keys> extends false ? Keys : never
>(
key: Key | ResourceKeys | Path,
key: Key | ResourceKeys,
defaultMsg: string,
options: TranslateOptions
): TranslateResult
Expand All @@ -208,13 +207,13 @@ declare module 'vue' {
DefinedLocaleMessage extends
RemovedIndexResources<DefineLocaleMessage> = RemovedIndexResources<DefineLocaleMessage>,
Keys = IsEmptyObject<DefinedLocaleMessage> extends false
? PickupPaths<{
? JsonPaths<{
[K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]
}>
: never,
ResourceKeys extends Keys = IsNever<Keys> extends false ? Keys : never
>(
key: Key | ResourceKeys | Path,
key: Key | ResourceKeys,
list: unknown[]
): TranslateResult
/**
Expand All @@ -234,13 +233,13 @@ declare module 'vue' {
DefinedLocaleMessage extends
RemovedIndexResources<DefineLocaleMessage> = RemovedIndexResources<DefineLocaleMessage>,
Keys = IsEmptyObject<DefinedLocaleMessage> extends false
? PickupPaths<{
? JsonPaths<{
[K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]
}>
: never,
ResourceKeys extends Keys = IsNever<Keys> extends false ? Keys : never
>(
key: Key | ResourceKeys | Path,
key: Key | ResourceKeys,
list: unknown[],
plural: number
): TranslateResult
Expand All @@ -261,16 +260,16 @@ declare module 'vue' {
DefinedLocaleMessage extends
RemovedIndexResources<DefineLocaleMessage> = RemovedIndexResources<DefineLocaleMessage>,
Keys = IsEmptyObject<DefinedLocaleMessage> extends false
? PickupPaths<{
? JsonPaths<{
[K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]
}>
: never,
ResourceKeys extends Keys = IsNever<Keys> extends false ? Keys : never
>(
key: Key | ResourceKeys | Path,
key: Key | ResourceKeys,
list: unknown[],
defaultMsg: string
): string
): TranslateResult
/**
* Locale message translation
*
Expand All @@ -288,13 +287,13 @@ declare module 'vue' {
DefinedLocaleMessage extends
RemovedIndexResources<DefineLocaleMessage> = RemovedIndexResources<DefineLocaleMessage>,
Keys = IsEmptyObject<DefinedLocaleMessage> extends false
? PickupPaths<{
? JsonPaths<{
[K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]
}>
: never,
ResourceKeys extends Keys = IsNever<Keys> extends false ? Keys : never
>(
key: Key | ResourceKeys | Path,
key: Key | ResourceKeys,
list: unknown[],
options: TranslateOptions
): TranslateResult
Expand All @@ -314,13 +313,13 @@ declare module 'vue' {
DefinedLocaleMessage extends
RemovedIndexResources<DefineLocaleMessage> = RemovedIndexResources<DefineLocaleMessage>,
Keys = IsEmptyObject<DefinedLocaleMessage> extends false
? PickupPaths<{
? JsonPaths<{
[K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]
}>
: never,
ResourceKeys extends Keys = IsNever<Keys> extends false ? Keys : never
>(
key: Key | ResourceKeys | Path,
key: Key | ResourceKeys,
named: NamedValue
): TranslateResult
/**
Expand All @@ -340,13 +339,13 @@ declare module 'vue' {
DefinedLocaleMessage extends
RemovedIndexResources<DefineLocaleMessage> = RemovedIndexResources<DefineLocaleMessage>,
Keys = IsEmptyObject<DefinedLocaleMessage> extends false
? PickupPaths<{
? JsonPaths<{
[K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]
}>
: never,
ResourceKeys extends Keys = IsNever<Keys> extends false ? Keys : never
>(
key: Key | ResourceKeys | Path,
key: Key | ResourceKeys,
named: NamedValue,
plural: number
): TranslateResult
Expand All @@ -367,13 +366,13 @@ declare module 'vue' {
DefinedLocaleMessage extends
RemovedIndexResources<DefineLocaleMessage> = RemovedIndexResources<DefineLocaleMessage>,
Keys = IsEmptyObject<DefinedLocaleMessage> extends false
? PickupPaths<{
? JsonPaths<{
[K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]
}>
: never,
ResourceKeys extends Keys = IsNever<Keys> extends false ? Keys : never
>(
key: Key | ResourceKeys | Path,
key: Key | ResourceKeys,
named: NamedValue,
defaultMsg: string
): TranslateResult
Expand All @@ -394,13 +393,13 @@ declare module 'vue' {
DefinedLocaleMessage extends
RemovedIndexResources<DefineLocaleMessage> = RemovedIndexResources<DefineLocaleMessage>,
Keys = IsEmptyObject<DefinedLocaleMessage> extends false
? PickupPaths<{
? JsonPaths<{
[K in keyof DefinedLocaleMessage]: DefinedLocaleMessage[K]
}>
: never,
ResourceKeys extends Keys = IsNever<Keys> extends false ? Keys : never
>(
key: Key | ResourceKeys | Path,
key: Key | ResourceKeys,
named: NamedValue,
options: TranslateOptions
): TranslateResult
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ async function main() {
process.exitCode = 1
}

if (['vue-i18n', 'pretite-vue-i18n'].includes(target)) {
if (['vue-i18n', 'petite-vue-i18n'].includes(target)) {
console.log()
console.log(
pc.bold(pc.yellow(`Appending Vue type definitions for ${target}...`))
Expand Down