Skip to content

Commit bf7587b

Browse files
committed
refactor: colocate pdf editor model types
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 6bd40f6 commit bf7587b

1 file changed

Lines changed: 39 additions & 1 deletion

File tree

src/components/PdfEditor/pdfEditorModel.ts

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,45 @@
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
55

6-
import type { PdfDocument, PdfEditorObject, PdfEditorSigner } from './types'
6+
import type { PDFElementObject } from '@libresign/pdf-elements'
7+
8+
import type { Coordinates, VisibleElement } from '../../services/visibleElementsService'
9+
import type { IdentifyMethodRecord } from '../../types/index'
10+
11+
export type PdfEditorSignerPlacement = {
12+
elementId?: VisibleElement['elementId']
13+
type?: VisibleElement['type']
14+
signRequestId?: VisibleElement['signRequestId']
15+
documentIndex?: number
16+
coordinates?: Coordinates
17+
}
18+
19+
export type PdfEditorSigner = {
20+
signRequestId?: number | string
21+
displayName?: string
22+
email?: string
23+
identifyMethods?: IdentifyMethodRecord[]
24+
readOnly?: boolean
25+
element?: PdfEditorSignerPlacement
26+
}
27+
28+
export type PdfEditorObject = PDFElementObject & {
29+
id: string
30+
signer?: PdfEditorSigner | null
31+
}
32+
33+
export type PdfPage = {
34+
getViewport: (options: { scale: number }) => {
35+
width: number
36+
height: number
37+
}
38+
}
39+
40+
export type PdfDocument = {
41+
numPages?: number
42+
pages?: Array<Promise<PdfPage>>
43+
allObjects?: PdfEditorObject[][]
44+
}
745

846
export type PdfObjectLocation = {
947
docIndex: number

0 commit comments

Comments
 (0)