Skip to content

Commit 3f08dcb

Browse files
authored
improvement type definition (#77)
* bump up typescript version * refactoring * add type definition for plural * updates * improve runtime and compiler type definition * updates * fix type errors * update core modules * update composer type definitions * update legacy type defintion * fix lint errors * extract runtime context for internal * bump up typescript-eslint * updates * bump to vue@rc * split runtime context * fix * fix lint error * update README * update api docs
1 parent facc0f3 commit 3f08dcb

File tree

230 files changed

+4125
-1253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+4125
-1253
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ yarn add vue-i18n@next
157157
- [x] number function
158158
- [x] warnHtmlMessage
159159
- [x] improve translate `args` typing
160-
- [ ] improve locale messages typing: `LocaleMessages` / `LocaleMessage` / `LocaleMessageDictiory`
160+
- [x] improve locale messages typing: `LocaleMessages` / `LocaleMessage` / `LocaleMessageDictiory`
161161
- [x] postTranslation context option
162162
- Composable API: I18n Composer
163163
- properties

docs/vue-i18n.availabilities.md

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [vue-i18n](./vue-i18n.md) &gt; [BaseFormatProps](./vue-i18n.baseformatprops.md) &gt; [locale](./vue-i18n.baseformatprops.locale.md)
4+
5+
## BaseFormatProps.locale property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
locale?: Locale;
11+
```

docs/vue-i18n.baseformatprops.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [vue-i18n](./vue-i18n.md) &gt; [BaseFormatProps](./vue-i18n.baseformatprops.md)
4+
5+
## BaseFormatProps interface
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
export interface BaseFormatProps
11+
```
12+
13+
## Properties
14+
15+
| Property | Type | Description |
16+
| --- | --- | --- |
17+
| [locale](./vue-i18n.baseformatprops.locale.md) | <code>Locale</code> | |
18+
| [scope](./vue-i18n.baseformatprops.scope.md) | <code>ComponetI18nScope</code> | |
19+
| [tag](./vue-i18n.baseformatprops.tag.md) | <code>string</code> | |
20+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [vue-i18n](./vue-i18n.md) &gt; [BaseFormatProps](./vue-i18n.baseformatprops.md) &gt; [scope](./vue-i18n.baseformatprops.scope.md)
4+
5+
## BaseFormatProps.scope property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
scope?: ComponetI18nScope;
11+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [vue-i18n](./vue-i18n.md) &gt; [BaseFormatProps](./vue-i18n.baseformatprops.md) &gt; [tag](./vue-i18n.baseformatprops.tag.md)
4+
5+
## BaseFormatProps.tag property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
tag?: string;
11+
```

docs/vue-i18n.clearcompilecache.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [vue-i18n](./vue-i18n.md) &gt; [clearCompileCache](./vue-i18n.clearcompilecache.md)
4+
5+
## clearCompileCache() function
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
export declare function clearCompileCache(): void;
11+
```
12+
<b>Returns:</b>
13+
14+
`void`
15+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [vue-i18n](./vue-i18n.md) &gt; [clearDateTimeFormat](./vue-i18n.cleardatetimeformat.md)
4+
5+
## clearDateTimeFormat() function
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
export declare function clearDateTimeFormat<DateTimeFormats = {}, Message = string>(ctx: RuntimeDateTimeContext<DateTimeFormats, Message>, locale: Locale, format: DateTimeFormat): void;
11+
```
12+
13+
## Parameters
14+
15+
| Parameter | Type | Description |
16+
| --- | --- | --- |
17+
| ctx | <code>RuntimeDateTimeContext&lt;DateTimeFormats, Message&gt;</code> | |
18+
| locale | <code>Locale</code> | |
19+
| format | <code>DateTimeFormat</code> | |
20+
21+
<b>Returns:</b>
22+
23+
`void`
24+

docs/vue-i18n.clearnumberformat.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [vue-i18n](./vue-i18n.md) &gt; [clearNumberFormat](./vue-i18n.clearnumberformat.md)
4+
5+
## clearNumberFormat() function
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
export declare function clearNumberFormat<NumberFormats, Message = string>(ctx: RuntimeNumberContext<NumberFormats, Message>, locale: Locale, format: NumberFormat): void;
11+
```
12+
13+
## Parameters
14+
15+
| Parameter | Type | Description |
16+
| --- | --- | --- |
17+
| ctx | <code>RuntimeNumberContext&lt;NumberFormats, Message&gt;</code> | |
18+
| locale | <code>Locale</code> | |
19+
| format | <code>NumberFormat</code> | |
20+
21+
<b>Returns:</b>
22+
23+
`void`
24+

docs/vue-i18n.compile.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<b>Signature:</b>
88

99
```typescript
10-
export declare function compile(source: string, options?: CompileOptions): MessageFunction;
10+
export declare function compile<T = string>(source: string, options?: CompileOptions): MessageFunction<T>;
1111
```
1212

1313
## Parameters
@@ -19,5 +19,5 @@ export declare function compile(source: string, options?: CompileOptions): Messa
1919

2020
<b>Returns:</b>
2121

22-
`MessageFunction`
22+
`MessageFunction<T>`
2323

0 commit comments

Comments
 (0)