nesties 1.1.10 → 1.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +27 -272
- package/dist/index.cjs.map +4 -4
- package/dist/index.mjs +26 -271
- package/dist/index.mjs.map +3 -3
- package/dist/src/i18n-module/i18n-module.options.d.ts +2 -3
- package/dist/src/i18n-module/i18n-token.d.ts +0 -1
- package/dist/src/i18n-module/i18n.service.d.ts +9 -14
- package/dist/src/i18n-module/i18n.types.d.ts +6 -0
- package/dist/src/i18n-module/index.d.ts +0 -1
- package/dist/src/i18n-module/middlewares/lookup.d.ts +4 -9
- package/package.json +2 -2
- package/dist/src/i18n-module/i18n-middleware.type.d.ts +0 -3
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
import { ExecutionContext } from '@nestjs/common';
|
|
2
2
|
import { I18nModuleOptions } from './i18n-module.options';
|
|
3
|
-
import { I18nMiddleware } from './i18n-middleware.type';
|
|
4
3
|
import { ModuleRef } from '@nestjs/core';
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { I18n } from 'nfkit';
|
|
5
|
+
import { I18nNesties } from './i18n.types';
|
|
6
|
+
export declare class I18nService extends I18n<I18nNesties.Ex> {
|
|
7
|
+
private i18nServiceOptions;
|
|
7
8
|
private moduleRef;
|
|
8
|
-
constructor(
|
|
9
|
-
private
|
|
10
|
-
private locales;
|
|
11
|
-
private defaultLocale;
|
|
12
|
-
private middlewares;
|
|
13
|
-
middleware(mw: I18nMiddleware, prior?: boolean): void;
|
|
9
|
+
constructor(i18nServiceOptions: I18nModuleOptions, moduleRef: ModuleRef);
|
|
10
|
+
private _shadowMiddlewareMap;
|
|
14
11
|
private logger;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
middleware(mw: I18nNesties.Middleware, prior?: boolean): this;
|
|
13
|
+
removeMiddleware(mw: I18nNesties.Middleware): this;
|
|
14
|
+
private resolver;
|
|
18
15
|
getExactLocaleFromRequest(ctx: ExecutionContext): Promise<string>;
|
|
19
|
-
translateString(locale: string, text: string, ctx?: ExecutionContext): Promise<string>;
|
|
20
|
-
translate<T>(locale: string, obj: T, ctx?: ExecutionContext): Promise<T>;
|
|
21
16
|
translateRequest(ctx: ExecutionContext, obj: any): Promise<any>;
|
|
22
17
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type MatchType = 'exact' | 'hierarchy' | 'startsWith';
|
|
6
|
-
export declare const I18nLookupMiddleware: (dict: I18nDictionary | ((locale: string, key: string, ctx?: ExecutionContext) => Awaitable<I18nDictionary>), options?: {
|
|
7
|
-
matchType?: MatchType;
|
|
8
|
-
}) => I18nMiddleware;
|
|
9
|
-
export {};
|
|
1
|
+
import { I18nNesties } from '../i18n.types';
|
|
2
|
+
export declare const I18nLookupMiddleware: (dict: import("nfkit").I18nDictionary | ((locale: string, key: string, ctx?: import("@nestjs/common").ExecutionContext) => import("nfkit").Awaitable<import("nfkit").I18nDictionary>), options?: {
|
|
3
|
+
matchType?: "startsWith" | "exact" | "hierarchy";
|
|
4
|
+
}) => import("nfkit").I18nMiddleware<I18nNesties.Ex>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nesties",
|
|
3
3
|
"description": "Nest.js utilities",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.11",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"rxjs": ">=7.0.0"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"nfkit": "^1.0.
|
|
87
|
+
"nfkit": "^1.0.10",
|
|
88
88
|
"typed-reflector": "^1.0.13"
|
|
89
89
|
}
|
|
90
90
|
}
|