i18next 15.1.2 → 15.1.3

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/index.d.ts +124 -0
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 15.1.3
2
+
3
+ - typescript: Fix type error when init with locize plugin options [1248](https://github.com/i18next/i18next/pull/1248)
4
+
1
5
  ### 15.1.2
2
6
 
3
7
  - typescript: types(ReactOptions): Add missing props to React Options interface [1247](https://github.com/i18next/i18next/pull/1247)
package/index.d.ts CHANGED
@@ -417,6 +417,125 @@ declare namespace i18next {
417
417
  * @default 'v3'
418
418
  */
419
419
  compatibilityJSON?: 'v1' | 'v2' | 'v3';
420
+
421
+ /**
422
+ * Options for https://github.com/locize/locize-editor
423
+ * @default undefined
424
+ */
425
+ editor?: {
426
+ /**
427
+ * Enable on init without the need of adding querystring locize=true
428
+ * @default false
429
+ */
430
+ enabled?: boolean;
431
+ /**
432
+ * If set to false you will need to open the editor via API
433
+ * @default true
434
+ */
435
+ autoOpen?: boolean;
436
+
437
+ /**
438
+ * Enable by adding querystring locize=true; can be set to another value or turned off by setting to false
439
+ * @default 'locize'
440
+ */
441
+ enableByQS?: string | false;
442
+
443
+ /**
444
+ * Turn on/off by pressing key combination. Combine this with `toggleKeyCode`
445
+ * @default 'ctrlKey'
446
+ */
447
+ toggleKeyModifier?: 'ctrlKey' | 'metaKey' | 'altKey' | 'shiftKey';
448
+ /**
449
+ * Turn on/off by pressing key combination. Combine this with `toggleKeyModifier`
450
+ * @default 24 (x)
451
+ */
452
+ toggleKeyCode?: number;
453
+
454
+ /**
455
+ * Use lng in editor taken from query string, eg. if running with lng=cimode (i18next, locize)
456
+ * @default 'useLng'
457
+ */
458
+ lngOverrideQS?: string;
459
+
460
+ /**
461
+ * Use lng in editor, eg. if running with lng=cimode (i18next, locize)
462
+ * @default null
463
+ */
464
+ lngOverride?: string | null;
465
+
466
+ /**
467
+ * How the editor will open.
468
+ * Setting to window will open a new window/tab instead
469
+ * @default 'iframe'
470
+ */
471
+ mode?: 'iframe' | 'window';
472
+
473
+ /**
474
+ * Styles to adapt layout in iframe mode to your website layout.
475
+ * This will add a style to the `<iframe>`
476
+ * @default 'z-index: 2000; position: fixed; top: 0; right: 0; bottom: 0; width: 600px; box-shadow: -3px 0 5px 0 rgba(0,0,0,0.5);'
477
+ */
478
+ iframeContainerStyle?: string;
479
+ /**
480
+ * Styles to adapt layout in iframe mode to your website layout.
481
+ * This will add a style to the parent of `<iframe>`
482
+ * @default 'height: 100%; width: 600px; border: none;'
483
+ */
484
+ iframeStyle?: string;
485
+ /**
486
+ * Styles to adapt layout in iframe mode to your website layout.
487
+ * This will add a style to `<body>`
488
+ * @default 'margin-right: 605px;'
489
+ */
490
+ bodyStyle?: string;
491
+
492
+ /**
493
+ * Handle when locize saved the edited translations, eg. reload website
494
+ * @default noop
495
+ */
496
+ onEditorSaved?: (lng: null, ns: string | string[]) => void;
497
+ };
498
+
499
+ /**
500
+ * Options for https://github.com/locize/locize-lastused
501
+ * @default undefined
502
+ */
503
+ locizeLastUsed?: {
504
+ /**
505
+ * The id of your locize project
506
+ */
507
+ projectId: string;
508
+
509
+ /**
510
+ * An api key if you want to send missing keys
511
+ */
512
+ apiKey?: string;
513
+
514
+ /**
515
+ * The reference language of your project
516
+ * @default 'en'
517
+ */
518
+ referenceLng?: string;
519
+
520
+ /**
521
+ * Version
522
+ * @default 'latest'
523
+ */
524
+ version?: string;
525
+
526
+ /**
527
+ * Debounce interval to send data in milliseconds
528
+ * @default 90000
529
+ */
530
+ debounceSubmit?: number;
531
+
532
+ /**
533
+ * Hostnames that are allowed to send last used data.
534
+ * Please keep those to your local system, staging, test servers (not production)
535
+ * @default ['localhost']
536
+ */
537
+ allowedHosts?: string[];
538
+ };
420
539
  }
421
540
 
422
541
  interface TOptionsBase {
@@ -844,6 +963,11 @@ declare namespace i18next {
844
963
  * Is initialized
845
964
  */
846
965
  isInitialized: boolean;
966
+
967
+ /**
968
+ * Emit event
969
+ */
970
+ emit(eventName: string): void;
847
971
  }
848
972
  }
849
973
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "i18next",
3
- "version": "15.1.2",
3
+ "version": "15.1.3",
4
4
  "description": "i18next internationalization framework",
5
5
  "main": "./index.js",
6
6
  "types": "index.d.ts",