@discord/intl-message-database 0.20.1 → 0.21.1-canary.ad1c466
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/index.d.ts +27 -28
- package/package.json +11 -11
package/index.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ export declare class IntlMessagesDatabase {
|
|
|
4
4
|
constructor()
|
|
5
5
|
findAllMessagesFiles(directories: Array<string>, defaultDefinitionLocale: string): Array<IntlMessagesFileDescriptor>
|
|
6
6
|
filterAllMessagesFiles(files: Array<string>, defaultDefinitionLocale: string): Array<IntlMessagesFileDescriptor>
|
|
7
|
-
processAllMessagesFiles(directories: Array<IntlMessagesFileDescriptor>):
|
|
8
|
-
processDefinitionsFile(filePath: string, locale?: string | undefined | null):
|
|
9
|
-
processDefinitionsFileContent(filePath: string, content: string, locale?: string | undefined | null):
|
|
10
|
-
processAllTranslationFiles(localeMap: Record<string, string>):
|
|
11
|
-
processTranslationFile(filePath: string, locale: string):
|
|
12
|
-
processTranslationFileContent(filePath: string, locale: string, content: string):
|
|
7
|
+
processAllMessagesFiles(directories: Array<IntlMessagesFileDescriptor>): Array<IntlSourceFileInsertionData>
|
|
8
|
+
processDefinitionsFile(filePath: string, locale?: string | undefined | null): IntlSourceFileInsertionData
|
|
9
|
+
processDefinitionsFileContent(filePath: string, content: string, locale?: string | undefined | null): IntlSourceFileInsertionData
|
|
10
|
+
processAllTranslationFiles(localeMap: Record<string, string>): Array<IntlSourceFileInsertionData>
|
|
11
|
+
processTranslationFile(filePath: string, locale: string): IntlSourceFileInsertionData
|
|
12
|
+
processTranslationFileContent(filePath: string, locale: string, content: string): IntlSourceFileInsertionData
|
|
13
13
|
getKnownLocales(): Array<string>
|
|
14
14
|
getSourceFile(filePath: string): IntlSourceFile
|
|
15
15
|
getAllSourceFilePaths(): Array<string>
|
|
@@ -27,6 +27,13 @@ export declare class IntlMessagesDatabase {
|
|
|
27
27
|
getSourceFileMessageValues(filePath: string): Record<string, IntlMessageValue | undefined>
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
export declare class Message {
|
|
31
|
+
key: string
|
|
32
|
+
value: string
|
|
33
|
+
line: number
|
|
34
|
+
col: number
|
|
35
|
+
}
|
|
36
|
+
|
|
30
37
|
export declare function hashMessageKey(key: string): string
|
|
31
38
|
|
|
32
39
|
export declare const enum IntlCompiledMessageFormat {
|
|
@@ -82,16 +89,6 @@ export interface IntlMessageValue {
|
|
|
82
89
|
filePosition: object
|
|
83
90
|
}
|
|
84
91
|
|
|
85
|
-
export interface IntlMultiProcessingFailure {
|
|
86
|
-
file: string
|
|
87
|
-
error: string
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface IntlMultiProcessingResult {
|
|
91
|
-
processed: Array<string>
|
|
92
|
-
failed: Array<IntlMultiProcessingFailure>
|
|
93
|
-
}
|
|
94
|
-
|
|
95
92
|
export interface IntlSourceFile {
|
|
96
93
|
type: string
|
|
97
94
|
file: string
|
|
@@ -100,6 +97,19 @@ export interface IntlSourceFile {
|
|
|
100
97
|
meta: IntlSourceFileMeta
|
|
101
98
|
}
|
|
102
99
|
|
|
100
|
+
export interface IntlSourceFileError {
|
|
101
|
+
key?: string
|
|
102
|
+
locale?: string
|
|
103
|
+
message: string
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface IntlSourceFileInsertionData {
|
|
107
|
+
fileKey: string
|
|
108
|
+
insertedCount: number
|
|
109
|
+
removedCount: number
|
|
110
|
+
errors: Array<IntlSourceFileError>
|
|
111
|
+
}
|
|
112
|
+
|
|
103
113
|
export interface IntlSourceFileMeta {
|
|
104
114
|
description: string
|
|
105
115
|
secret: boolean
|
|
@@ -112,18 +122,7 @@ export declare function isMessageDefinitionsFile(key: string): boolean
|
|
|
112
122
|
|
|
113
123
|
export declare function isMessageTranslationsFile(key: string): boolean
|
|
114
124
|
|
|
115
|
-
export interface Message {
|
|
116
|
-
key: string
|
|
117
|
-
value: string
|
|
118
|
-
position: Position
|
|
119
|
-
}
|
|
120
|
-
|
|
121
125
|
export declare function parseJson(text: string): Message[]
|
|
122
126
|
|
|
123
|
-
export declare function parseJsonFile(filePath: string):
|
|
124
|
-
|
|
125
|
-
export interface Position {
|
|
126
|
-
line: number
|
|
127
|
-
col: number
|
|
128
|
-
}
|
|
127
|
+
export declare function parseJsonFile(filePath: string): Message[]
|
|
129
128
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@discord/intl-message-database",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.1-canary.ad1c466",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Rust-based Node extension module for parsing, extracting, and managing messages and translations across a project.",
|
|
6
6
|
"author": "Jon Egeland",
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
"url": "https://github.com/discord/discord-intl"
|
|
16
16
|
},
|
|
17
17
|
"optionalDependencies": {
|
|
18
|
-
"@discord/intl-message-database-darwin-arm64": "0.
|
|
19
|
-
"@discord/intl-message-database-
|
|
20
|
-
"@discord/intl-message-database-linux-arm64-
|
|
21
|
-
"@discord/intl-message-database-linux-
|
|
22
|
-
"@discord/intl-message-database-
|
|
23
|
-
"@discord/intl-message-database-
|
|
24
|
-
"@discord/intl-message-database-win32-
|
|
25
|
-
"@discord/intl-message-database-
|
|
26
|
-
"@discord/intl-message-database-win32-ia32-msvc": "0.
|
|
18
|
+
"@discord/intl-message-database-darwin-arm64": "0.21.1-canary.ad1c466",
|
|
19
|
+
"@discord/intl-message-database-linux-arm64-gnu": "0.21.1-canary.ad1c466",
|
|
20
|
+
"@discord/intl-message-database-linux-arm64-musl": "0.21.1-canary.ad1c466",
|
|
21
|
+
"@discord/intl-message-database-linux-x64-gnu": "0.21.1-canary.ad1c466",
|
|
22
|
+
"@discord/intl-message-database-darwin-x64": "0.21.1-canary.ad1c466",
|
|
23
|
+
"@discord/intl-message-database-linux-x64-musl": "0.21.1-canary.ad1c466",
|
|
24
|
+
"@discord/intl-message-database-win32-arm64-msvc": "0.21.1-canary.ad1c466",
|
|
25
|
+
"@discord/intl-message-database-win32-x64-msvc": "0.21.1-canary.ad1c466",
|
|
26
|
+
"@discord/intl-message-database-win32-ia32-msvc": "0.21.1-canary.ad1c466"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@napi-rs/cli": "^2.18.3",
|
|
30
|
-
"@discord/intl-ast": "0.
|
|
30
|
+
"@discord/intl-ast": "0.21.1-canary.ad1c466"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": ">= 10"
|