Skip to content

Commit 7cd637e

Browse files
committed
Make addTool backwards compatible
1 parent 165718b commit 7cd637e

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

examples/vue-vuetify/src/components/Application.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const { engine, isLoading: engineLoading, error: engineError } = usePdfiumEngine
7676
7777
const handleInitialized = async (registry: PluginRegistry) => {
7878
const annotation = registry.getPlugin<AnnotationPlugin>('annotation')?.provides();
79-
annotation?.addTool({
79+
annotation?.addTool<AnnotationTool<PdfStampAnnoObject>>({
8080
id: 'stampApproved',
8181
name: 'Stamp Approved',
8282
interaction: {

packages/plugin-annotation/src/lib/tools/default-tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ const linkTools = [
571571
name: 'Link',
572572
labelKey: 'annotation.link',
573573
categories: ['annotation', 'markup'],
574-
matchScore: (a) => (a.type === PdfAnnotationSubtype.LINK && !a.inReplyToId ? 1 : 0),
574+
matchScore: (a) => (a.type === PdfAnnotationSubtype.LINK ? 1 : 0),
575575
interaction: {
576576
exclusive: false,
577577
cursor: 'crosshair',

packages/plugin-annotation/src/lib/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ export interface AnnotationCapability<TTools extends AnnotationToolMap = Annotat
480480
<TId extends ToolId<TTools>>(toolId: TId): ToolEntry<TTools, TId> | undefined;
481481
(toolId: string): AnnotationTool | undefined;
482482
};
483-
addTool: (tool: AnnotationTool<any>) => void;
483+
addTool: <T extends AnnotationTool<any> = AnnotationTool<any>>(tool: T) => void;
484484
findToolForAnnotation: (annotation: PdfAnnotationObject) => ToolUnion<TTools> | null;
485485
setToolDefaults: {
486486
<TId extends ToolId<TTools>>(

0 commit comments

Comments
 (0)