Skip to content

Commit

Permalink
feat(i18n): add options field
Browse files Browse the repository at this point in the history
* PR Feedback
  • Loading branch information
mickr committed May 9, 2020
1 parent 2d4fa4e commit 13d2f65
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/BoxAnnotations.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import getProp from 'lodash/get';
import DocumentAnnotator from './document/DocumentAnnotator';
import { Permissions, PERMISSIONS, Type } from './@types';

type AnnotationsOptions = {
language?: string;
locale?: string;
messages?: Record<string, string>;
};
import { IntlOptions, Permissions, PERMISSIONS, Type } from './@types';

type Annotator = {
CONSTRUCTOR: typeof DocumentAnnotator;
Expand Down Expand Up @@ -53,7 +47,7 @@ const ANNOTATORS: Annotator[] = [
class BoxAnnotations {
annotators: Annotator[];

annotationsOptions?: AnnotationsOptions;
annotationsOptions?: IntlOptions;

viewerOptions?: ViewerOptions | null;

Expand All @@ -64,7 +58,7 @@ class BoxAnnotations {
* @param {AnnotationsOptions } options - options passed to the annotations instance
* @return {BoxAnnotations} BoxAnnotations instance
*/
constructor(viewerOptions?: ViewerOptions, options?: AnnotationsOptions) {
constructor(viewerOptions?: ViewerOptions, options?: IntlOptions) {
this.annotators = ANNOTATORS;
this.annotationsOptions = options;
this.viewerOptions = viewerOptions;
Expand Down Expand Up @@ -124,7 +118,7 @@ class BoxAnnotations {
return { ...annotator, TYPES: enabledTypes };
}

getOptions(): AnnotationsOptions | undefined {
getOptions(): IntlOptions | undefined {
return this.annotationsOptions;
}
}
Expand Down

0 comments on commit 13d2f65

Please sign in to comment.