2024-07-11 16:16:36 +02:00
|
|
|
import { MarkType } from "./drawing";
|
|
|
|
|
|
|
|
export interface Mark {
|
|
|
|
/**
|
|
|
|
* @key png (pdf page) file hash
|
|
|
|
*/
|
|
|
|
[key: string]: MarkConfigDetails[]
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MarkConfig {
|
|
|
|
/**
|
|
|
|
* @key user npub
|
|
|
|
*/
|
|
|
|
[key: string]: User
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface User {
|
|
|
|
/**
|
|
|
|
* @key png (pdf page) file hash
|
|
|
|
*/
|
|
|
|
[key: string]: MarkConfigDetails[]
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MarkDetails {
|
|
|
|
/**
|
|
|
|
* @key coords in format X:10;Y:50
|
|
|
|
*/
|
|
|
|
[key: string]: MarkValue
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MarkValue {
|
|
|
|
value: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MarkConfigDetails {
|
|
|
|
markType: MarkType;
|
|
|
|
/**
|
|
|
|
* Coordinates in format: X:10;Y:50
|
|
|
|
*/
|
2024-07-17 11:25:02 +03:00
|
|
|
markLocation: MarkLocation;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MarkLocation {
|
|
|
|
top: number;
|
|
|
|
left: number;
|
|
|
|
height: number;
|
|
|
|
width: number;
|
|
|
|
page: number;
|
2024-07-11 16:16:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Creator Meta Object Example
|
|
|
|
const creatorMetaExample = {
|
|
|
|
"fileHashes": {
|
|
|
|
// PDF Hash
|
|
|
|
"Lorem ipsum dolor sit amet.pdf": "da5f857e77d3aa59c461efad804116931c059b36e6b4da0b5d9452753ec70c05",
|
|
|
|
// PDF Pages (in png format) hashes
|
|
|
|
// Page 1
|
|
|
|
"da5f857e77d3aa59c461efad804116931c059b36e6b4da0b5d9452753ec70c05/1.png": "hash123png1",
|
|
|
|
// Page 2
|
|
|
|
"da5f857e77d3aa59c461efad804116931c059b36e6b4da0b5d9452753ec70c05/2.png": "hash321png2"
|
|
|
|
},
|
|
|
|
"markConfig": {
|
|
|
|
// Signer npub
|
|
|
|
'npub1x77qywdllzetv9ncnhlfpv62kshlgtt0uqlsq3v22uzzkk2xvvrsn6uyfy': {
|
|
|
|
// PDF Page 1 (PNG file hash)
|
2024-07-12 14:19:59 +02:00
|
|
|
'da5f857e77d3aa59c461efad804116931c059b36e6b4da0b5d9452753ec70c05/1.png': [
|
2024-07-11 16:16:36 +02:00
|
|
|
{
|
|
|
|
markType: "FULLNAME",
|
|
|
|
markLocation: "X:56;Y:306"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
// PDF Page 2 (PNG file hash)
|
2024-07-12 14:19:59 +02:00
|
|
|
'da5f857e77d3aa59c461efad804116931c059b36e6b4da0b5d9452753ec70c05/2.png': [
|
2024-07-11 16:16:36 +02:00
|
|
|
{
|
|
|
|
markType: "FULLNAME",
|
|
|
|
markLocation: "X:76;Y:283.71875"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Signer meta example
|
|
|
|
const signerExample = {
|
|
|
|
"prevSig": "10de030dd2bfafbbd34969645bd0b3f5e8ab71b3b32091fb29bbea5e272f8a3b7284ef667b6a02e9becc1036450d9fbe5c1c6d146fa91d70e0d8f3cd54d64f17",
|
|
|
|
"marks": {
|
|
|
|
// PDF Page 1 (PNG file hash)
|
2024-07-12 14:19:59 +02:00
|
|
|
'da5f857e77d3aa59c461efad804116931c059b36e6b4da0b5d9452753ec70c05/1.png': {
|
2024-07-11 16:16:36 +02:00
|
|
|
// Mark coordinates
|
|
|
|
"X:56;Y:306": {
|
|
|
|
value: 'Pera Peric'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// PDF Page 2 (PNG file hash)
|
2024-07-12 14:19:59 +02:00
|
|
|
'da5f857e77d3aa59c461efad804116931c059b36e6b4da0b5d9452753ec70c05/2.png': {
|
2024-07-11 16:16:36 +02:00
|
|
|
// Mark coordinates
|
|
|
|
"X:76;Y:283.71875": {
|
|
|
|
value: 'Pera Peric'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|