Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
windingwind committed Dec 8, 2024
1 parent 085d393 commit 353e086
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
20 changes: 15 additions & 5 deletions src/utils/relation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function closeRelationServer() {
}
}

async function getRelationServer() {
async function getRelationServer(): Promise<MessageHelper<typeof handlers>> {
if (!addon.data.relation.server) {
const worker = new Worker(
`chrome://${config.addonRef}/content/scripts/relationWorker.js`,
Expand Down Expand Up @@ -95,7 +95,9 @@ async function updateNoteLinkRelation(noteID: number) {
);
}

async function getNoteLinkOutboundRelation(noteID: number) {
async function getNoteLinkOutboundRelation(
noteID: number,
): Promise<LinkModel[]> {
const note = Zotero.Items.get(noteID);
const fromLibID = note.libraryID;
const fromKey = note.key;
Expand All @@ -104,7 +106,9 @@ async function getNoteLinkOutboundRelation(noteID: number) {
).proxy.getOutboundLinks(fromLibID, fromKey);
}

async function getNoteLinkInboundRelation(noteID: number) {
async function getNoteLinkInboundRelation(
noteID: number,
): Promise<LinkModel[]> {
const note = Zotero.Items.get(noteID);
const toLibID = note.libraryID;
const toKey = note.key;
Expand Down Expand Up @@ -135,13 +139,19 @@ async function linkAnnotationToTarget(model: AnnotationModel) {
return await (await getRelationServer()).proxy.linkAnnotationToTarget(model);
}

async function getLinkTargetByAnnotation(fromLibID: number, fromKey: string) {
async function getLinkTargetByAnnotation(
fromLibID: number,
fromKey: string,
): Promise<AnnotationModel | undefined> {
return await (
await getRelationServer()
).proxy.getLinkTargetByAnnotation(fromLibID, fromKey);
}

async function getAnnotationByLinkTarget(toLibID: number, toKey: string) {
async function getAnnotationByLinkTarget(
toLibID: number,
toKey: string,
): Promise<AnnotationModel | undefined> {
return await (
await getRelationServer()
).proxy.getAnnotationByLinkTarget(toLibID, toKey);
Expand Down
3 changes: 0 additions & 3 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"composite": true
},
"include": ["./**/*.spec.ts", "typings", "../node_modules/zotero-types"],
"exclude": []
}
4 changes: 0 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
"skipLibCheck": true,
"alwaysStrict": false,
"strict": true,
"composite": true
},
"include": ["src", "typings", "node_modules/zotero-types"],
"exclude": ["build", "addon", "test"],
"references": [
{ "path": "./test" }
]
}

0 comments on commit 353e086

Please sign in to comment.