summaryrefslogtreecommitdiff
path: root/node_modules/bcp-47/lib/parse.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/bcp-47/lib/parse.d.ts')
-rw-r--r--node_modules/bcp-47/lib/parse.d.ts29
1 files changed, 29 insertions, 0 deletions
diff --git a/node_modules/bcp-47/lib/parse.d.ts b/node_modules/bcp-47/lib/parse.d.ts
new file mode 100644
index 0000000..ef18cc1
--- /dev/null
+++ b/node_modules/bcp-47/lib/parse.d.ts
@@ -0,0 +1,29 @@
+/**
+ * Parse a BCP 47 language tag.
+ *
+ * @param {string} tag
+ * @param {Options} [options]
+ * @returns {Schema}
+ */
+export function parse(tag: string, options?: Options | undefined): Schema
+export type Warning = (reason: string, code: number, offset: number) => void
+export type Options = {
+ normalize?: boolean | undefined
+ forgiving?: boolean | undefined
+ warning?: Warning | undefined
+}
+export type Extension = {
+ singleton: string
+ extensions: Array<string>
+}
+export type Schema = {
+ language: string | null | undefined
+ extendedLanguageSubtags: Array<string>
+ script: string | null | undefined
+ region: string | null | undefined
+ variants: Array<string>
+ extensions: Array<Extension>
+ privateuse: Array<string>
+ irregular: string | null | undefined
+ regular: string | null | undefined
+}