@kittl/pdfkit 0.13.0 → 0.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ // Ambient typings to make custom Jest matchers available to the TS language server in tests.
2
+ // No external @types packages required.
3
+
4
+ type PartialExceptTheseRequired<T, K extends keyof T> = Partial<T> &
5
+ Pick<Required<T>, K>;
6
+
7
+ declare global {
8
+ // Minimal shape of a TextStream used by tests' helpers
9
+ interface TextStream {
10
+ text: string;
11
+ font: string;
12
+ fontSize: number;
13
+ }
14
+
15
+ type TextStreamMatcher = PartialExceptTheseRequired<TextStream, 'text'>;
16
+
17
+ namespace jest {
18
+ interface Matchers<R> {
19
+ // Expect the PDF data array to contain a specific chunk sequence
20
+ toContainChunk(chunk: Array<string | RegExp>): R;
21
+
22
+ // Expect the PDF data array to contain a text stream matching the TextStream
23
+ toContainText(textStream: TextStreamMatcher): R;
24
+ }
25
+ }
26
+ }
27
+
28
+ export {};