diff --git a/package-lock.json b/package-lock.json index de21790..0008eec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.1.0", "license": "MIT", "dependencies": { + "@types/js-yaml": "^4.0.9", "js-yaml": "^4.1.0", "react": "^18.2.0", "react-dom": "^18.2.0" @@ -583,6 +584,11 @@ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, + "node_modules/@types/js-yaml": { + "version": "4.0.9", + "resolved": "https://registry.npmmirror.com/@types/js-yaml/-/js-yaml-4.0.9.tgz", + "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==" + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -2668,6 +2674,11 @@ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, + "@types/js-yaml": { + "version": "4.0.9", + "resolved": "https://registry.npmmirror.com/@types/js-yaml/-/js-yaml-4.0.9.tgz", + "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==" + }, "@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz", diff --git a/package.json b/package.json index 3cd4fcd..5c691aa 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "typescript": "4.7.4" }, "dependencies": { + "@types/js-yaml": "^4.0.9", "js-yaml": "^4.1.0", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/src/processor/contributionGraphCodeBlockProcessor.ts b/src/processor/contributionGraphCodeBlockProcessor.ts index 9dd176d..b70a411 100644 --- a/src/processor/contributionGraphCodeBlockProcessor.ts +++ b/src/processor/contributionGraphCodeBlockProcessor.ts @@ -75,6 +75,7 @@ export class ContributionGraphRawProcessor { } try { + // @ts-ignore return load(code); } catch (e) { if (e.mark?.line) { diff --git a/src/processor/dataFetcher.ts b/src/processor/dataFetcher.ts index ff154c5..d0e5c94 100644 --- a/src/processor/dataFetcher.ts +++ b/src/processor/dataFetcher.ts @@ -23,6 +23,7 @@ export class DataviewDataFetcher { groupByCustomField(result: any, dateFieldName: string) { const convertFailedPages: ConvertFail[] = []; const data = result + // @ts-ignore .filter((page) => { if (page[dateFieldName]) { try { @@ -45,9 +46,11 @@ export class DataviewDataFetcher { }); return false; }) + // @ts-ignore .groupBy((page) => { return page[dateFieldName].toFormat("yyyy-MM-dd"); }) + // @ts-ignore .map((entry) => { return { date: entry.key, @@ -61,14 +64,18 @@ export class DataviewDataFetcher { } groupByFileCTime(data: any) { - return data - .groupBy((p) => p.file.ctime.toFormat("yyyy-MM-dd")) - .map((entry) => { - return { - date: entry.key, - value: entry.rows.length, - }; - }); + return ( + data + // @ts-ignore + .groupBy((p) => p.file.ctime.toFormat("yyyy-MM-dd")) + // @ts-ignore + .map((entry) => { + return { + date: entry.key, + value: entry.rows.length, + }; + }) + ); } } diff --git a/src/util/tooltips.ts b/src/util/tooltips.ts index f6f369b..49b6a94 100644 --- a/src/util/tooltips.ts +++ b/src/util/tooltips.ts @@ -10,6 +10,7 @@ export function showTips(event: MouseEvent, text: string) { // 调整 tooltip 元素的位置 if (event.target) { + //@ts-ignore const rect = event.target.getBoundingClientRect(); tooltip.style.top = rect.top - tooltip.offsetHeight - 5 + "px"; tooltip.style.left = rect.left + "px"; diff --git a/src/util/utils.ts b/src/util/utils.ts index 42d8e88..f08de76 100644 --- a/src/util/utils.ts +++ b/src/util/utils.ts @@ -10,6 +10,7 @@ export function mapBy( for (const item of arr) { const key = keyMapping(item); if (map.has(key)) { + //@ts-ignore map.set(key, aggregator(map.get(key), valueMapping(item))); } else { map.set(key, valueMapping(item)); diff --git a/src/view/form/CellRuleFormItem.tsx b/src/view/form/CellRuleFormItem.tsx index baaf7b6..1ca63c8 100644 --- a/src/view/form/CellRuleFormItem.tsx +++ b/src/view/form/CellRuleFormItem.tsx @@ -17,6 +17,7 @@ export function CellRuleItem(props: {