2025-07-16 17:53:50 +01:00
|
|
|
export const SPLIT_MODES = {
|
|
|
|
BY_PAGES: 'byPages',
|
2025-08-11 09:16:16 +01:00
|
|
|
BY_SECTIONS: 'bySections',
|
2025-07-16 17:53:50 +01:00
|
|
|
BY_SIZE_OR_COUNT: 'bySizeOrCount',
|
|
|
|
BY_CHAPTERS: 'byChapters'
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export const SPLIT_TYPES = {
|
|
|
|
SIZE: 'size',
|
|
|
|
PAGES: 'pages',
|
|
|
|
DOCS: 'docs'
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export const ENDPOINTS = {
|
|
|
|
[SPLIT_MODES.BY_PAGES]: 'split-pages',
|
|
|
|
[SPLIT_MODES.BY_SECTIONS]: 'split-pdf-by-sections',
|
|
|
|
[SPLIT_MODES.BY_SIZE_OR_COUNT]: 'split-by-size-or-count',
|
|
|
|
[SPLIT_MODES.BY_CHAPTERS]: 'split-pdf-by-chapters'
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export type SplitMode = typeof SPLIT_MODES[keyof typeof SPLIT_MODES];
|
2025-08-11 09:16:16 +01:00
|
|
|
export type SplitType = typeof SPLIT_TYPES[keyof typeof SPLIT_TYPES];
|
|
|
|
|
|
|
|
export const isSplitMode = (value: string | null): value is SplitMode => {
|
|
|
|
return Object.values(SPLIT_MODES).includes(value as SplitMode);
|
|
|
|
}
|
|
|
|
|
|
|
|
export const isSplitType = (value: string | null): value is SplitType => {
|
|
|
|
return Object.values(SPLIT_TYPES).includes(value as SplitType);
|
|
|
|
}
|