Skip to content

Commit 4e479bd

Browse files
committed
fixed d.ts
1 parent 5436350 commit 4e479bd

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

debug/types-debug.ts

+12
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ async function main() {
1717
exifrDefault.parse('')
1818
exifrDefault.parse('', ['foo'])
1919
exifrDefault.orientation('').then(or => console.log(or))
20+
21+
exifr.parse('../test/fixtures/002.tiff')
22+
exifr.parse('../test/fixtures/002.tiff', true)
23+
exifr.parse('../test/fixtures/002.tiff', {tiff: true})
24+
exifr.parse('../test/fixtures/002.tiff', {xmp: {parse: false}})
25+
exifr.parse('../test/fixtures/002.tiff', {tiff: true, ifd0: {translateValues: false}})
26+
27+
exifr.thumbnail('../test/fixtures/002.tiff', 'no second argument');
28+
exifr.thumbnailUrl('../test/fixtures/002.tiff', 'no second argument');
29+
exifr.gps('../test/fixtures/002.tiff', 'no second argument');
30+
exifr.orientation('../test/fixtures/002.tiff', 'no second argument');
31+
exifr.rotation('../test/fixtures/002.tiff', 'no second argument');
2032
}
2133

2234
main()

index.d.ts

+11-6
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,28 @@ interface FormatOptions {
2121
translateKeys?: boolean,
2222
translateValues?: boolean,
2323
reviveValues?: boolean,
24+
parse?: boolean, // XMP only
2425
}
2526

2627
interface Options extends FormatOptions {
27-
// TIFF segment
28+
// TIFF segment IFD blocks
2829
tiff?: FormatOptions | boolean,
2930
ifd0?: FormatOptions, // cannot be disabled.
3031
ifd1?: FormatOptions | boolean,
3132
exif?: FormatOptions | boolean,
3233
gps?: FormatOptions | boolean,
3334
interop?: FormatOptions | boolean,
35+
// notable properties in TIFF
36+
makerNote?: boolean,
37+
userComment?: boolean,
3438
// Other segments
35-
jfif?: FormatOptions | boolean,
36-
iptc?: FormatOptions | boolean,
3739
xmp?: FormatOptions | boolean,
3840
icc?: FormatOptions | boolean,
39-
makerNote?: boolean,
40-
userComment?: boolean,
41+
iptc?: FormatOptions | boolean,
42+
// JPEG only segment
43+
jfif?: FormatOptions | boolean,
44+
// PNG only only segment
45+
ihdr?: FormatOptions | boolean,
4146
// other options
4247
sanitize?: boolean,
4348
mergeOutput?: boolean,
@@ -56,7 +61,7 @@ interface IRotation {
5661
canvas: boolean;
5762
}
5863

59-
export function parse(data: Input, options?: Options | Filter): Promise<any>;
64+
export function parse(data: Input, options?: Options | Filter | boolean): Promise<any>;
6065
export function thumbnail(data: Input): Promise<Uint8Array | Buffer | undefined>;
6166
export function thumbnailUrl(data: Input): Promise<string>;
6267
export function gps(data: Input): Promise<GpsOutput>;

0 commit comments

Comments
 (0)