Skip to content

Commit 2401904

Browse files
committed
refactor: keep visible elements pdf editor api local
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 18212f2 commit 2401904

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/components/Request/VisibleElements.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ import { subscribe, unsubscribe, type Event as NextcloudEvent, type EventHandler
8989
import { loadState } from '@nextcloud/initial-state'
9090
import { t } from '@nextcloud/l10n'
9191
import { generateOcsUrl } from '@nextcloud/router'
92-
import { computed, getCurrentInstance, nextTick, onBeforeUnmount, onMounted, ref } from 'vue'
92+
import { computed, getCurrentInstance, nextTick, onBeforeUnmount, onMounted, ref, type ComponentPublicInstance } from 'vue'
9393
9494
import PdfEditor from '../PdfEditor/PdfEditor.vue'
95-
import type { PdfEditorObject, PdfEditorPublicApi, PdfEditorSigner } from '../PdfEditor/types'
95+
import type { PdfEditorObject, PdfEditorSigner } from '../PdfEditor/pdfEditorModel'
9696
import Signer from '../Signers/Signer.vue'
9797
9898
import { FILE_STATUS } from '../../constants.js'
@@ -167,8 +167,11 @@ type PdfElementsRef = {
167167
isAddingMode?: boolean
168168
}
169169
170-
type PdfEditorRef = PdfEditorPublicApi & {
170+
type PdfEditorRef = ComponentPublicInstance & {
171171
$refs?: { pdfElements?: PdfElementsRef }
172+
startAddingSigner?: (signer: PlacementSigner | null | undefined, size: { width?: number, height?: number }) => boolean
173+
cancelAdding?: () => void
174+
addSigner?: (signer: PlacementSigner) => Promise<void>
172175
}
173176
174177
type FilesStore = Pick<ReturnType<typeof useFilesStore>, 'loading' | 'getFile' | 'saveOrUpdateSignatureRequest'> & {
@@ -715,7 +718,7 @@ function buildVisibleElements() {
715718
716719
for (let docIndex = 0; docIndex < numDocuments; docIndex++) {
717720
const objects = pdfElements?.getAllObjects(docIndex) || []
718-
objects.forEach((object) => {
721+
objects.forEach((object: PdfObject) => {
719722
if (!object.signer) return
720723
721724
let globalPageNumber = object.pageNumber

0 commit comments

Comments
 (0)