Skip to content

Commit d9493b1

Browse files
authored
docs: add support api mode for injection APIs (#655)
closes #644
1 parent a058a99 commit d9493b1

File tree

1 file changed

+55
-153
lines changed

1 file changed

+55
-153
lines changed

docs/api/injection.md

Lines changed: 55 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ Locale message translation
237237
$t(key: Path, plural: number): string;
238238
```
239239

240+
:::tip NOTE
241+
Supported for **Commposition API mode only**.
242+
:::
243+
240244
**Details**
241245

242246
Overloaded `$t`. About details, see the [$t](injection#t-key) remarks.
@@ -260,6 +264,10 @@ Locale message translation
260264
$t(key: Path, plural: number, options: TranslateOptions): string;
261265
```
262266

267+
:::tip NOTE
268+
Supported for **Commposition API mode only**.
269+
:::
270+
263271
**Details**
264272

265273
Overloaded `$t`. About details, see the [$t](injection#t-key) remarks.
@@ -284,6 +292,10 @@ Locale message translation
284292
$t(key: Path, defaultMsg: string): string;
285293
```
286294

295+
:::tip NOTE
296+
Supported for **Commposition API mode only**.
297+
:::
298+
287299
**Details**
288300

289301
Overloaded `$t`. About details, see the [$t](injection#t-key) remarks.
@@ -307,6 +319,10 @@ Locale message translation
307319
$t(key: Path, defaultMsg: string, options: TranslateOptions): string;
308320
```
309321

322+
:::tip NOTE
323+
Supported for **Commposition API mode only**.
324+
:::
325+
310326
**Details**
311327

312328
Overloaded `$t`. About details, see the [$t](injection#t-key) remarks.
@@ -354,6 +370,10 @@ Locale message translation
354370
$t(key: Path, list: unknown[], plural: number): string;
355371
```
356372

373+
:::tip NOTE
374+
Supported for **Commposition API mode only**.
375+
:::
376+
357377
**Details**
358378

359379
Overloaded `$t`. About details, see the [$t](injection#t-key) remarks.
@@ -378,6 +398,10 @@ Locale message translation
378398
$t(key: Path, list: unknown[], defaultMsg: string): string;
379399
```
380400

401+
:::tip NOTE
402+
Supported for **Commposition API mode only**.
403+
:::
404+
381405
**Details**
382406

383407
Overloaded `$t`. About details, see the [$t](injection#t-key) remarks.
@@ -402,6 +426,10 @@ Locale message translation
402426
$t(key: Path, list: unknown[], options: TranslateOptions): string;
403427
```
404428

429+
:::tip NOTE
430+
Supported for **Commposition API mode only**.
431+
:::
432+
405433
**Details**
406434

407435
Overloaded `$t`. About details, see the [$t](injection#t-key) remarks.
@@ -449,6 +477,10 @@ Locale message translation
449477
$t(key: Path, named: NamedValue, plural: number): string;
450478
```
451479

480+
:::tip NOTE
481+
Supported for **Commposition API mode only**.
482+
:::
483+
452484
**Details**
453485

454486
Overloaded `$t`. About details, see the [$t](injection#t-key) remarks.
@@ -473,6 +505,10 @@ Locale message translation
473505
$t(key: Path, named: NamedValue, defaultMsg: string): string;
474506
```
475507

508+
:::tip NOTE
509+
Supported for **Commposition API mode only**.
510+
:::
511+
476512
**Details**
477513

478514
Overloaded `$t`. About details, see the [$t](injection#t-key) remarks.
@@ -497,6 +533,10 @@ Locale message translation
497533
$t(key: Path, named: NamedValue, options: TranslateOptions): string;
498534
```
499535

536+
:::tip NOTE
537+
Supported for **Commposition API mode only**.
538+
:::
539+
500540
**Details**
501541

502542
Overloaded `$t`. About details, see the [$t](injection#t-key) remarks.
@@ -623,7 +663,7 @@ Locale message pluralization
623663
$tc(key: Path): TranslateResult;
624664
```
625665

626-
:::tip NOTE
666+
:::warning NOTE
627667
Supported for **Legacy API mode only**.
628668
:::
629669

@@ -656,7 +696,7 @@ Locale message pluralization
656696
$tc(key: Path, locale: Locale): TranslateResult;
657697
```
658698

659-
:::tip NOTE
699+
:::warning NOTE
660700
Supported for **Legacy API mode only**.
661701
:::
662702

@@ -683,7 +723,7 @@ Locale message pluralization
683723
$tc(key: Path, list: unknown[]): TranslateResult;
684724
```
685725

686-
:::tip NOTE
726+
:::warning NOTE
687727
Supported for **Legacy API mode only**.
688728
:::
689729

@@ -710,7 +750,7 @@ Locale message pluralization
710750
$tc(key: Path, named: Record<string, unknown>): TranslateResult;
711751
```
712752

713-
:::tip NOTE
753+
:::warning NOTE
714754
Supported for **Legacy API mode only**.
715755
:::
716756

@@ -737,7 +777,7 @@ Locale message pluralization
737777
$tc(key: Path, choice: number): TranslateResult;
738778
```
739779

740-
:::tip NOTE
780+
:::warning NOTE
741781
Supported for **Legacy API mode only**.
742782
:::
743783

@@ -764,7 +804,7 @@ Locale message pluralization
764804
$tc(key: Path, choice: number, locale: Locale): TranslateResult;
765805
```
766806

767-
:::tip NOTE
807+
:::warning NOTE
768808
Supported for **Legacy API mode only**.
769809
:::
770810

@@ -792,7 +832,7 @@ Locale message pluralization
792832
$tc(key: Path, choice: number, list: unknown[]): TranslateResult;
793833
```
794834

795-
:::tip NOTE
835+
:::warning NOTE
796836
Supported for **Legacy API mode only**.
797837
:::
798838

@@ -820,7 +860,7 @@ Locale message pluralization
820860
$tc(key: Path, choice: number, named: Record<string, unknown>): TranslateResult;
821861
```
822862

823-
:::tip NOTE
863+
:::warning NOTE
824864
Supported for **Legacy API mode only**.
825865
:::
826866

@@ -848,7 +888,7 @@ Translation message exist
848888
$te(key: Path, locale?: Locale): boolean;
849889
```
850890

851-
:::tip NOTE
891+
:::warning NOTE
852892
Supported for **Legacy API mode only**.
853893
:::
854894

@@ -902,7 +942,7 @@ Datetime formatting
902942

903943
**Signature:**
904944
```typescript
905-
$d(value: number | Date): DateTimeFormatResult;
945+
$d(value: number | Date): DateTimeFormatResult | string;
906946
```
907947

908948
**Details**
@@ -933,7 +973,7 @@ Datetime formatting
933973

934974
**Signature:**
935975
```typescript
936-
$d(value: number | Date, key: string): DateTimeFormatResult;
976+
$d(value: number | Date, key: string): DateTimeFormatResult | string;
937977
```
938978

939979
**Details**
@@ -956,7 +996,7 @@ Datetime formatting
956996

957997
**Signature:**
958998
```typescript
959-
$d(value: number | Date, key: string, locale: Locale): DateTimeFormatResult;
999+
$d(value: number | Date, key: string, locale: Locale): DateTimeFormatResult | string;
9601000
```
9611001

9621002
**Details**
@@ -997,75 +1037,6 @@ Overloaded `$d`. About details, see the [$d](injection#d-value) remarks.
9971037

9981038
Formatted value
9991039

1000-
### $d(value)
1001-
1002-
Datetime formatting
1003-
1004-
**Signature:**
1005-
```typescript
1006-
$d(value: number | Date): string;
1007-
```
1008-
1009-
**Details**
1010-
1011-
Overloaded `$d`. About details, see the [$d](injection#d-value) remarks.
1012-
1013-
#### Parameters
1014-
| Parameter | Type | Description |
1015-
| --- | --- | --- |
1016-
| value | number \| Date | A value, timestamp number or `Date` instance |
1017-
1018-
#### Returns
1019-
1020-
Formatted value
1021-
1022-
### $d(value, key)
1023-
1024-
Datetime formatting
1025-
1026-
**Signature:**
1027-
```typescript
1028-
$d(value: number | Date, key: string): string;
1029-
```
1030-
1031-
**Details**
1032-
1033-
Overloaded `$d`. About details, see the [$d](injection#d-value) remarks.
1034-
1035-
#### Parameters
1036-
| Parameter | Type | Description |
1037-
| --- | --- | --- |
1038-
| value | number \| Date | A value, timestamp number or `Date` instance |
1039-
| key | string | A key of datetime formats |
1040-
1041-
#### Returns
1042-
1043-
Formatted value
1044-
1045-
### $d(value, key, locale)
1046-
1047-
Datetime formatting
1048-
1049-
**Signature:**
1050-
```typescript
1051-
$d(value: number | Date, key: string, locale: Locale): string;
1052-
```
1053-
1054-
**Details**
1055-
1056-
Overloaded `$d`. About details, see the [$d](injection#d-value) remarks.
1057-
1058-
#### Parameters
1059-
| Parameter | Type | Description |
1060-
| --- | --- | --- |
1061-
| value | number \| Date | A value, timestamp number or `Date` instance |
1062-
| key | string | A key of datetime formats |
1063-
| locale | Locale | A locale, override locale that global scope or local scope |
1064-
1065-
#### Returns
1066-
1067-
Formatted value
1068-
10691040
### $d(value, options)
10701041

10711042
Datetime formatting
@@ -1095,7 +1066,7 @@ Number formatting
10951066

10961067
**Signature:**
10971068
```typescript
1098-
$n(value: number): NumberFormatResult;
1069+
$n(value: number): NumberFormatResult | string;
10991070
```
11001071

11011072
**Details**
@@ -1126,7 +1097,7 @@ Number formatting
11261097

11271098
**Signature:**
11281099
```typescript
1129-
$n(value: number, key: string): NumberFormatResult;
1100+
$n(value: number, key: string): NumberFormatResult | string;
11301101
```
11311102

11321103
**Details**
@@ -1149,7 +1120,7 @@ Number formatting
11491120

11501121
**Signature:**
11511122
```typescript
1152-
$n(value: number, key: string, locale: Locale): NumberFormatResult;
1123+
$n(value: number, key: string, locale: Locale): NumberFormatResult | string;
11531124
```
11541125

11551126
**Details**
@@ -1239,75 +1210,6 @@ Overloaded `$n`. About details, see the [$n](injection#n-value) remarks.
12391210

12401211
Formatted value
12411212

1242-
### $n(value)
1243-
1244-
Number formatting
1245-
1246-
**Signature:**
1247-
```typescript
1248-
$n(value: number): string;
1249-
```
1250-
1251-
**Details**
1252-
1253-
Overloaded `$n`. About details, see the [$n](injection#n-value) remarks.
1254-
1255-
#### Parameters
1256-
| Parameter | Type | Description |
1257-
| --- | --- | --- |
1258-
| value | number | A number value |
1259-
1260-
#### Returns
1261-
1262-
Formatted value
1263-
1264-
### $n(value, key)
1265-
1266-
Number formatting
1267-
1268-
**Signature:**
1269-
```typescript
1270-
$n(value: number, key: string): string;
1271-
```
1272-
1273-
**Details**
1274-
1275-
Overloaded `$n`. About details, see the [$n](injection#n-value) remarks.
1276-
1277-
#### Parameters
1278-
| Parameter | Type | Description |
1279-
| --- | --- | --- |
1280-
| value | number | A number value |
1281-
| key | string | A key of number formats |
1282-
1283-
#### Returns
1284-
1285-
Formatted value
1286-
1287-
### $n(value, key, locale)
1288-
1289-
Number formatting
1290-
1291-
**Signature:**
1292-
```typescript
1293-
$n(value: number, key: string, locale: Locale): string;
1294-
```
1295-
1296-
**Details**
1297-
1298-
Overloaded `$n`. About details, see the [$n](injection#n-value) remarks.
1299-
1300-
#### Parameters
1301-
| Parameter | Type | Description |
1302-
| --- | --- | --- |
1303-
| value | number | A number value |
1304-
| key | string | A key of number formats |
1305-
| locale | Locale | A locale, override locale that global scope or local scope |
1306-
1307-
#### Returns
1308-
1309-
Formatted value
1310-
13111213
### $n(value, options)
13121214

13131215
Number formatting

0 commit comments

Comments
 (0)