Skip to content

Commit

Permalink
Merge pull request #29 from andrewdotn/maintainable-types
Browse files Browse the repository at this point in the history
Declare only the types we actually use
  • Loading branch information
andrewdotn authored Apr 7, 2021
2 parents 55d5393 + f1861d9 commit b5530e9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
6 changes: 0 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"lint-fix": "eslint --fix . --ext .ts,.js"
},
"devDependencies": {
"@altlab/types": "^1.1.1",
"@types/chrome": "0.0.127",
"@types/jquery": "^3.5.5",
"@types/node": "^14.14.11",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/transover_core.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {TransOver} from './transover_utils'
import XRegExp from 'xregexp/src'
import {SerializedSearchResult} from '@altlab/types'
import {options} from "./options";
/// <reference path="html_loader.d.ts"/>
import popup from './popup.html'
Expand All @@ -11,6 +10,7 @@ import Node = JQuery.Node;
/// <reference path="raw_loader.d.ts"/>
import popupScript from 'raw-loader!ts-loader!./popup.raw'
import tatPopupScript from 'raw-loader!ts-loader!./tat_popup.raw'
import {SerializedSearchResult} from "./types";


const popupTemplate = buildTemplateFromString(popup)
Expand Down
14 changes: 14 additions & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// These are the things returned by the intelligent dictionary click-in-text API
// that are actually used by this package.

export interface SerializedDefinition {
text: string;
source_ids: string[];
}
export interface SerializedWordform {
text: string;
definitions: SerializedDefinition[];
}
export interface SerializedSearchResult {
lemma_wordform: SerializedWordform;
}

0 comments on commit b5530e9

Please sign in to comment.