@camera.ui/sdk 0.0.4 → 0.0.7

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.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,3 @@
1
- /// <reference types="node" />
2
- import * as node_stream from 'node:stream';
3
-
4
1
  /**
5
2
  * Camera device type.
6
3
  * - `camera`: Standard surveillance camera
@@ -56,18 +53,6 @@ type RTSPAudioCodec = 'aac' | 'opus' | 'pcma';
56
53
  * Audio codecs supported for stream probing.
57
54
  */
58
55
  type ProbeAudioCodec = 'aac' | 'opus' | 'pcma';
59
- /**
60
- * Internal decoder output format.
61
- */
62
- type DecoderFormat = 'nv12';
63
- /**
64
- * Supported image input formats for processing.
65
- */
66
- type ImageInputFormat = DecoderFormat | 'rgb' | 'rgba' | 'gray';
67
- /**
68
- * Supported image output formats after processing.
69
- */
70
- type ImageOutputFormat = 'rgb' | 'rgba' | 'gray';
71
56
  /**
72
57
  * Motion detection resolution setting.
73
58
  * Higher resolution = more accurate but slower.
@@ -105,7 +90,7 @@ type DetectionEventState = 'active' | 'ended';
105
90
  */
106
91
  type EventTriggerType = 'motion' | 'audio' | 'contact' | 'doorbell' | 'switch' | 'light' | 'siren' | 'security_system' | 'line-crossing';
107
92
  /**
108
- * Stream direction (used in audio/video stream info).
93
+ * Stream direction (from SDP).
109
94
  */
110
95
  type StreamDirection = 'sendonly' | 'recvonly' | 'sendrecv' | 'inactive';
111
96
 
@@ -205,6 +190,17 @@ declare class Subject<T> {
205
190
  get closed(): boolean;
206
191
  next(value: T): void;
207
192
  complete(): void;
193
+ /**
194
+ * Register a handler invoked once when this Subject completes. Runs
195
+ * immediately if already completed. Used by {@link firstValueFrom}.
196
+ *
197
+ * @internal
198
+ *
199
+ * @param handler - Completion callback.
200
+ *
201
+ * @returns Disposable that cancels the registration.
202
+ */
203
+ _onComplete(handler: () => void): Disposable;
208
204
  subscribe(callback: (value: T) => void): Disposable;
209
205
  pipe(): Observable<T>;
210
206
  pipe<A>(op1: OperatorFn<T, A>): Observable<A>;
@@ -362,8 +358,10 @@ declare function share<T>(config?: {
362
358
  }): OperatorFn<T, T>;
363
359
  /**
364
360
  * Subscribe to the source and return a Promise that resolves with its first
365
- * emitted value, then disposes the subscription. Rejects if the source has
366
- * already completed without emitting.
361
+ * emitted value, then disposes the subscription. Rejects if the source
362
+ * completes before emitting (Subject, BehaviorSubject, ReplaySubject). A bare
363
+ * Observable has no completion signal, so the Promise stays pending until it
364
+ * emits.
367
365
  *
368
366
  * @param observable - Source stream to await.
369
367
  *
@@ -1096,9 +1094,13 @@ declare enum BatteryProperty {
1096
1094
  }
1097
1095
  /** Battery charging state */
1098
1096
  declare enum ChargingState {
1097
+ /** Device has no rechargeable battery */
1099
1098
  NotChargeable = "NOT_CHARGEABLE",
1099
+ /** Battery is not charging */
1100
1100
  NotCharging = "NOT_CHARGING",
1101
+ /** Battery is currently charging */
1101
1102
  Charging = "CHARGING",
1103
+ /** Battery is fully charged */
1102
1104
  Full = "FULL"
1103
1105
  }
1104
1106
  /**
@@ -1431,7 +1433,7 @@ interface FaceResult {
1431
1433
  */
1432
1434
  declare abstract class FaceDetectorSensor<TStorage extends object = Record<string, any>> extends FaceSensor<TStorage> {
1433
1435
  _requiresFrames: boolean;
1434
- /** Declares the expected input dimensions and trigger labels. */
1436
+ /** Declares the expected input dimensions and trigger labels. The backend scales frames to match. */
1435
1437
  abstract get modelSpec(): ModelSpec;
1436
1438
  /**
1437
1439
  * Detect faces in batch. Each frame is a pre-cropped, pre-scaled person
@@ -1783,7 +1785,7 @@ interface LicensePlateResult {
1783
1785
  */
1784
1786
  declare abstract class LicensePlateDetectorSensor<TStorage extends object = Record<string, any>> extends LicensePlateSensor<TStorage> {
1785
1787
  _requiresFrames: boolean;
1786
- /** Declares the expected input dimensions and trigger labels. */
1788
+ /** Declares the expected input dimensions and trigger labels. The backend scales frames to match. */
1787
1789
  abstract get modelSpec(): ModelSpec;
1788
1790
  /**
1789
1791
  * Detect license plates in batch. Each frame is a pre-cropped, pre-scaled
@@ -2482,10 +2484,15 @@ declare class PTZControl<TStorage extends object = Record<string, any>> extends
2482
2484
 
2483
2485
  /** Security system arm/disarm states (HomeKit-compatible values) */
2484
2486
  declare enum SecuritySystemState {
2487
+ /** Armed, occupants home */
2485
2488
  StayArm = 0,
2489
+ /** Armed, occupants away */
2486
2490
  AwayArm = 1,
2491
+ /** Armed for night mode */
2487
2492
  NightArm = 2,
2493
+ /** System disarmed */
2488
2494
  Disarmed = 3,
2495
+ /** Alarm is triggered */
2489
2496
  AlarmTriggered = 4
2490
2497
  }
2491
2498
  /**
@@ -3328,6 +3335,9 @@ interface AudioDetectionSettings {
3328
3335
  /** Audio dwell time in seconds */
3329
3336
  timeout: number;
3330
3337
  }
3338
+ /**
3339
+ * PTZ autotracking settings — automatically follow detected objects.
3340
+ */
3331
3341
  interface PtzAutotrackSettings {
3332
3342
  /** Whether PTZ autotracking is enabled */
3333
3343
  enabled: boolean;
@@ -3365,2088 +3375,37 @@ interface CameraDetectionSettings {
3365
3375
  snooze?: boolean;
3366
3376
  }
3367
3377
 
3368
- type ColorLike$1 = ColorInstance | string | ArrayLike<number> | number | Record<string, any>;
3369
- type ColorJson = {
3370
- model: string;
3371
- color: number[];
3372
- valpha: number;
3373
- };
3374
- type ColorObject = {
3375
- alpha?: number | undefined;
3376
- } & Record<string, number>;
3377
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
3378
- interface ColorInstance {
3379
- toString(): string;
3380
- // eslint-disable-next-line @typescript-eslint/naming-convention
3381
- toJSON(): ColorJson;
3382
- string(places?: number): string;
3383
- percentString(places?: number): string;
3384
- array(): number[];
3385
- object(): ColorObject;
3386
- unitArray(): number[];
3387
- unitObject(): {
3388
- r: number;
3389
- g: number;
3390
- b: number;
3391
- alpha?: number | undefined;
3392
- };
3393
- round(places?: number): ColorInstance;
3394
- alpha(): number;
3395
- alpha(value: number): ColorInstance;
3396
- red(): number;
3397
- red(value: number): ColorInstance;
3398
- green(): number;
3399
- green(value: number): ColorInstance;
3400
- blue(): number;
3401
- blue(value: number): ColorInstance;
3402
- hue(): number;
3403
- hue(value: number): ColorInstance;
3404
- saturationl(): number;
3405
- saturationl(value: number): ColorInstance;
3406
- lightness(): number;
3407
- lightness(value: number): ColorInstance;
3408
- saturationv(): number;
3409
- saturationv(value: number): ColorInstance;
3410
- value(): number;
3411
- value(value: number): ColorInstance;
3412
- chroma(): number;
3413
- chroma(value: number): ColorInstance;
3414
- gray(): number;
3415
- gray(value: number): ColorInstance;
3416
- white(): number;
3417
- white(value: number): ColorInstance;
3418
- wblack(): number;
3419
- wblack(value: number): ColorInstance;
3420
- cyan(): number;
3421
- cyan(value: number): ColorInstance;
3422
- magenta(): number;
3423
- magenta(value: number): ColorInstance;
3424
- yellow(): number;
3425
- yellow(value: number): ColorInstance;
3426
- black(): number;
3427
- black(value: number): ColorInstance;
3428
- x(): number;
3429
- x(value: number): ColorInstance;
3430
- y(): number;
3431
- y(value: number): ColorInstance;
3432
- z(): number;
3433
- z(value: number): ColorInstance;
3434
- l(): number;
3435
- l(value: number): ColorInstance;
3436
- a(): number;
3437
- a(value: number): ColorInstance;
3438
- b(): number;
3439
- b(value: number): ColorInstance;
3440
- keyword(): string;
3441
- keyword<V extends string>(value: V): ColorInstance;
3442
- hex(): string;
3443
- hex<V extends string>(value: V): ColorInstance;
3444
- hexa(): string;
3445
- hexa<V extends string>(value: V): ColorInstance;
3446
- rgbNumber(): number;
3447
- luminosity(): number;
3448
- contrast(color2: ColorInstance): number;
3449
- level(color2: ColorInstance): "AAA" | "AA" | "";
3450
- isDark(): boolean;
3451
- isLight(): boolean;
3452
- negate(): ColorInstance;
3453
- lighten(ratio: number): ColorInstance;
3454
- darken(ratio: number): ColorInstance;
3455
- saturate(ratio: number): ColorInstance;
3456
- desaturate(ratio: number): ColorInstance;
3457
- whiten(ratio: number): ColorInstance;
3458
- blacken(ratio: number): ColorInstance;
3459
- grayscale(): ColorInstance;
3460
- fade(ratio: number): ColorInstance;
3461
- opaquer(ratio: number): ColorInstance;
3462
- rotate(degrees: number): ColorInstance;
3463
- mix(mixinColor: ColorInstance, weight?: number): ColorInstance;
3464
- rgb(...arguments_: number[]): ColorInstance;
3465
- hsl(...arguments_: number[]): ColorInstance;
3466
- hsv(...arguments_: number[]): ColorInstance;
3467
- hwb(...arguments_: number[]): ColorInstance;
3468
- cmyk(...arguments_: number[]): ColorInstance;
3469
- xyz(...arguments_: number[]): ColorInstance;
3470
- lab(...arguments_: number[]): ColorInstance;
3471
- lch(...arguments_: number[]): ColorInstance;
3472
- ansi16(...arguments_: number[]): ColorInstance;
3473
- ansi256(...arguments_: number[]): ColorInstance;
3474
- hcg(...arguments_: number[]): ColorInstance;
3475
- apple(...arguments_: number[]): ColorInstance;
3378
+ /**
3379
+ * Frame worker (decoder) settings.
3380
+ */
3381
+ interface CameraFrameWorkerSettings {
3382
+ /** Target frames per second for detection */
3383
+ fps: number;
3476
3384
  }
3477
-
3478
3385
  /**
3479
- * Copyright 2017 François Nguyen and others.
3480
- *
3481
- * Billy Kwok <https://github.com/billykwok>
3482
- * Bradley Odell <https://github.com/BTOdell>
3483
- * Espen Hovlandsdal <https://github.com/rexxars>
3484
- * Floris de Bijl <https://github.com/Fdebijl>
3485
- * François Nguyen <https://github.com/phurytw>
3486
- * Jamie Woodbury <https://github.com/JamieWoodbury>
3487
- * Wooseop Kim <https://github.com/wooseopkim>
3488
- *
3489
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3490
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3491
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
3492
- * permit persons to whom the Software is furnished to do so, subject to the following conditions:
3493
- *
3494
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3495
- * the Software.
3496
- *
3497
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
3498
- * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
3499
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
3500
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3386
+ * Snapshot settings for a camera.
3501
3387
  */
3502
-
3503
- // SPDX-License-Identifier: MIT
3504
-
3505
-
3506
- declare type Duplex = node_stream.Duplex;
3507
- declare type ColorLike = ColorLike$1;
3508
-
3509
- //#region Constructor functions
3388
+ interface SnapshotSettings {
3389
+ /** Enable automatic snapshot refresh */
3390
+ autoRefresh: boolean;
3391
+ /** Cache TTL in seconds (how long a snapshot is valid) */
3392
+ ttl: number;
3393
+ /** Auto-refresh interval in seconds (min: 10, max: 60) */
3394
+ interval: number;
3395
+ }
3510
3396
 
3511
3397
  /**
3512
- * Creates a sharp instance from an image
3513
- * @param input Buffer containing JPEG, PNG, WebP, AVIF, GIF, SVG, TIFF or raw pixel image data, or String containing the path to an JPEG, PNG, WebP, AVIF, GIF, SVG or TIFF image file.
3514
- * @param options Object with optional attributes.
3515
- * @throws {Error} Invalid parameters
3516
- * @returns A sharp instance that can be used to chain operations
3517
- */
3518
- declare function sharp(options?: sharp.SharpOptions): sharp.Sharp;
3519
- declare function sharp(
3520
- input?: sharp.SharpInput | Array<sharp.SharpInput>,
3521
- options?: sharp.SharpOptions,
3522
- ): sharp.Sharp;
3523
-
3524
- declare namespace sharp {
3525
- /** Object containing nested boolean values representing the available input and output formats/methods. */
3526
- const format: FormatEnum;
3527
-
3528
- /** An Object containing the version numbers of sharp, libvips and its dependencies. */
3529
- const versions: {
3530
- aom?: string | undefined;
3531
- archive?: string | undefined;
3532
- cairo?: string | undefined;
3533
- cgif?: string | undefined;
3534
- exif?: string | undefined;
3535
- expat?: string | undefined;
3536
- ffi?: string | undefined;
3537
- fontconfig?: string | undefined;
3538
- freetype?: string | undefined;
3539
- fribidi?: string | undefined;
3540
- glib?: string | undefined;
3541
- harfbuzz?: string | undefined;
3542
- heif?: string | undefined;
3543
- highway?: string | undefined;
3544
- imagequant?: string | undefined;
3545
- lcms?: string | undefined;
3546
- mozjpeg?: string | undefined;
3547
- pango?: string | undefined;
3548
- pixman?: string | undefined;
3549
- png?: string | undefined;
3550
- "proxy-libintl"?: string | undefined;
3551
- rsvg?: string | undefined;
3552
- sharp: string;
3553
- spng?: string | undefined;
3554
- tiff?: string | undefined;
3555
- vips: string;
3556
- webp?: string | undefined;
3557
- xml?: string | undefined;
3558
- "zlib-ng"?: string | undefined;
3559
- };
3560
-
3561
- /** An Object containing the available interpolators and their proper values */
3562
- const interpolators: Interpolators;
3563
-
3564
- /** An EventEmitter that emits a change event when a task is either queued, waiting for libuv to provide a worker thread, complete */
3565
- const queue: NodeJS.EventEmitter;
3566
-
3567
- //#endregion
3568
-
3569
- //#region Utility functions
3570
-
3571
- /**
3572
- * Gets or, when options are provided, sets the limits of libvips' operation cache.
3573
- * Existing entries in the cache will be trimmed after any change in limits.
3574
- * This method always returns cache statistics, useful for determining how much working memory is required for a particular task.
3575
- * @param options Object with the following attributes, or Boolean where true uses default cache settings and false removes all caching (optional, default true)
3576
- * @returns The cache results.
3577
- */
3578
- function cache(options?: boolean | CacheOptions): CacheResult;
3579
-
3580
- /**
3581
- * Gets or sets the number of threads libvips' should create to process each image.
3582
- * The default value is the number of CPU cores. A value of 0 will reset to this default.
3583
- * The maximum number of images that can be processed in parallel is limited by libuv's UV_THREADPOOL_SIZE environment variable.
3584
- * @param concurrency The new concurrency value.
3585
- * @returns The current concurrency value.
3586
- */
3587
- function concurrency(concurrency?: number): number;
3588
-
3589
- /**
3590
- * Provides access to internal task counters.
3591
- * @returns Object containing task counters
3592
- */
3593
- function counters(): SharpCounters;
3594
-
3595
- /**
3596
- * Get and set use of SIMD vector unit instructions. Requires libvips to have been compiled with highway support.
3597
- * Improves the performance of resize, blur and sharpen operations by taking advantage of the SIMD vector unit of the CPU, e.g. Intel SSE and ARM NEON.
3598
- * @param enable enable or disable use of SIMD vector unit instructions
3599
- * @returns true if usage of SIMD vector unit instructions is enabled
3600
- */
3601
- function simd(enable?: boolean): boolean;
3602
-
3603
- /**
3604
- * Block libvips operations at runtime.
3605
- *
3606
- * This is in addition to the `VIPS_BLOCK_UNTRUSTED` environment variable,
3607
- * which when set will block all "untrusted" operations.
3608
- *
3609
- * @since 0.32.4
3610
- *
3611
- * @example <caption>Block all TIFF input.</caption>
3612
- * sharp.block({
3613
- * operation: ['VipsForeignLoadTiff']
3614
- * });
3615
- *
3616
- * @param {Object} options
3617
- * @param {Array<string>} options.operation - List of libvips low-level operation names to block.
3618
- */
3619
- function block(options: { operation: string[] }): void;
3620
-
3621
- /**
3622
- * Unblock libvips operations at runtime.
3623
- *
3624
- * This is useful for defining a list of allowed operations.
3625
- *
3626
- * @since 0.32.4
3627
- *
3628
- * @example <caption>Block all input except WebP from the filesystem.</caption>
3629
- * sharp.block({
3630
- * operation: ['VipsForeignLoad']
3631
- * });
3632
- * sharp.unblock({
3633
- * operation: ['VipsForeignLoadWebpFile']
3634
- * });
3635
- *
3636
- * @example <caption>Block all input except JPEG and PNG from a Buffer or Stream.</caption>
3637
- * sharp.block({
3638
- * operation: ['VipsForeignLoad']
3639
- * });
3640
- * sharp.unblock({
3641
- * operation: ['VipsForeignLoadJpegBuffer', 'VipsForeignLoadPngBuffer']
3642
- * });
3643
- *
3644
- * @param {Object} options
3645
- * @param {Array<string>} options.operation - List of libvips low-level operation names to unblock.
3646
- */
3647
- function unblock(options: { operation: string[] }): void;
3648
-
3649
- //#endregion
3650
-
3651
- const gravity: GravityEnum;
3652
- const strategy: StrategyEnum;
3653
- const kernel: KernelEnum;
3654
- const fit: FitEnum;
3655
- const bool: BoolEnum;
3656
-
3657
- interface Sharp extends Duplex {
3658
- //#region Channel functions
3659
-
3660
- /**
3661
- * Remove alpha channel, if any. This is a no-op if the image does not have an alpha channel.
3662
- * @returns A sharp instance that can be used to chain operations
3663
- */
3664
- removeAlpha(): Sharp;
3665
-
3666
- /**
3667
- * Ensure alpha channel, if missing. The added alpha channel will be fully opaque. This is a no-op if the image already has an alpha channel.
3668
- * @param alpha transparency level (0=fully-transparent, 1=fully-opaque) (optional, default 1).
3669
- * @returns A sharp instance that can be used to chain operations
3670
- */
3671
- ensureAlpha(alpha?: number): Sharp;
3672
-
3673
- /**
3674
- * Extract a single channel from a multi-channel image.
3675
- * @param channel zero-indexed channel/band number to extract, or red, green, blue or alpha.
3676
- * @throws {Error} Invalid channel
3677
- * @returns A sharp instance that can be used to chain operations
3678
- */
3679
- extractChannel(channel: 0 | 1 | 2 | 3 | 'red' | 'green' | 'blue' | 'alpha'): Sharp;
3680
-
3681
- /**
3682
- * Join one or more channels to the image. The meaning of the added channels depends on the output colourspace, set with toColourspace().
3683
- * By default the output image will be web-friendly sRGB, with additional channels interpreted as alpha channels. Channel ordering follows vips convention:
3684
- * - sRGB: 0: Red, 1: Green, 2: Blue, 3: Alpha.
3685
- * - CMYK: 0: Magenta, 1: Cyan, 2: Yellow, 3: Black, 4: Alpha.
3686
- *
3687
- * Buffers may be any of the image formats supported by sharp.
3688
- * For raw pixel input, the options object should contain a raw attribute, which follows the format of the attribute of the same name in the sharp() constructor.
3689
- * @param images one or more images (file paths, Buffers).
3690
- * @param options image options, see sharp() constructor.
3691
- * @throws {Error} Invalid parameters
3692
- * @returns A sharp instance that can be used to chain operations
3693
- */
3694
- joinChannel(images: string | Buffer | ArrayLike<string | Buffer>, options?: SharpOptions): Sharp;
3695
-
3696
- /**
3697
- * Perform a bitwise boolean operation on all input image channels (bands) to produce a single channel output image.
3698
- * @param boolOp one of "and", "or" or "eor" to perform that bitwise operation, like the C logic operators &, | and ^ respectively.
3699
- * @throws {Error} Invalid parameters
3700
- * @returns A sharp instance that can be used to chain operations
3701
- */
3702
- bandbool(boolOp: keyof BoolEnum): Sharp;
3703
-
3704
- //#endregion
3705
-
3706
- //#region Color functions
3707
-
3708
- /**
3709
- * Tint the image using the provided colour.
3710
- * An alpha channel may be present and will be unchanged by the operation.
3711
- * @param tint Parsed by the color module.
3712
- * @returns A sharp instance that can be used to chain operations
3713
- */
3714
- tint(tint: ColorLike): Sharp;
3715
-
3716
- /**
3717
- * Convert to 8-bit greyscale; 256 shades of grey.
3718
- * This is a linear operation.
3719
- * If the input image is in a non-linear colour space such as sRGB, use gamma() with greyscale() for the best results.
3720
- * By default the output image will be web-friendly sRGB and contain three (identical) colour channels.
3721
- * This may be overridden by other sharp operations such as toColourspace('b-w'), which will produce an output image containing one colour channel.
3722
- * An alpha channel may be present, and will be unchanged by the operation.
3723
- * @param greyscale true to enable and false to disable (defaults to true)
3724
- * @returns A sharp instance that can be used to chain operations
3725
- */
3726
- greyscale(greyscale?: boolean): Sharp;
3727
-
3728
- /**
3729
- * Alternative spelling of greyscale().
3730
- * @param grayscale true to enable and false to disable (defaults to true)
3731
- * @returns A sharp instance that can be used to chain operations
3732
- */
3733
- grayscale(grayscale?: boolean): Sharp;
3734
-
3735
- /**
3736
- * Set the pipeline colourspace.
3737
- * The input image will be converted to the provided colourspace at the start of the pipeline.
3738
- * All operations will use this colourspace before converting to the output colourspace, as defined by toColourspace.
3739
- *
3740
- * @param colourspace pipeline colourspace e.g. rgb16, scrgb, lab, grey16 ...
3741
- * @throws {Error} Invalid parameters
3742
- * @returns A sharp instance that can be used to chain operations
3743
- */
3744
- pipelineColourspace(colourspace?: string): Sharp;
3745
-
3746
- /**
3747
- * Alternative spelling of pipelineColourspace
3748
- * @param colorspace pipeline colourspace e.g. rgb16, scrgb, lab, grey16 ...
3749
- * @throws {Error} Invalid parameters
3750
- * @returns A sharp instance that can be used to chain operations
3751
- */
3752
- pipelineColorspace(colorspace?: string): Sharp;
3753
-
3754
- /**
3755
- * Set the output colourspace.
3756
- * By default output image will be web-friendly sRGB, with additional channels interpreted as alpha channels.
3757
- * @param colourspace output colourspace e.g. srgb, rgb, cmyk, lab, b-w ...
3758
- * @throws {Error} Invalid parameters
3759
- * @returns A sharp instance that can be used to chain operations
3760
- */
3761
- toColourspace(colourspace?: string): Sharp;
3762
-
3763
- /**
3764
- * Alternative spelling of toColourspace().
3765
- * @param colorspace output colorspace e.g. srgb, rgb, cmyk, lab, b-w ...
3766
- * @throws {Error} Invalid parameters
3767
- * @returns A sharp instance that can be used to chain operations
3768
- */
3769
- toColorspace(colorspace: string): Sharp;
3770
-
3771
- //#endregion
3772
-
3773
- //#region Composite functions
3774
-
3775
- /**
3776
- * Composite image(s) over the processed (resized, extracted etc.) image.
3777
- *
3778
- * The images to composite must be the same size or smaller than the processed image.
3779
- * If both `top` and `left` options are provided, they take precedence over `gravity`.
3780
- * @param images - Ordered list of images to composite
3781
- * @throws {Error} Invalid parameters
3782
- * @returns A sharp instance that can be used to chain operations
3783
- */
3784
- composite(images: OverlayOptions[]): Sharp;
3785
-
3786
- //#endregion
3787
-
3788
- //#region Input functions
3789
-
3790
- /**
3791
- * Take a "snapshot" of the Sharp instance, returning a new instance.
3792
- * Cloned instances inherit the input of their parent instance.
3793
- * This allows multiple output Streams and therefore multiple processing pipelines to share a single input Stream.
3794
- * @returns A sharp instance that can be used to chain operations
3795
- */
3796
- clone(): Sharp;
3797
-
3798
- /**
3799
- * Fast access to (uncached) image metadata without decoding any compressed image data.
3800
- * @returns A sharp instance that can be used to chain operations
3801
- */
3802
- metadata(callback: (err: Error, metadata: Metadata) => void): Sharp;
3803
-
3804
- /**
3805
- * Fast access to (uncached) image metadata without decoding any compressed image data.
3806
- * @returns A promise that resolves with a metadata object
3807
- */
3808
- metadata(): Promise<Metadata>;
3809
-
3810
- /**
3811
- * Keep all metadata (EXIF, ICC, XMP, IPTC) from the input image in the output image.
3812
- * @returns A sharp instance that can be used to chain operations
3813
- */
3814
- keepMetadata(): Sharp;
3815
-
3816
- /**
3817
- * Access to pixel-derived image statistics for every channel in the image.
3818
- * @returns A sharp instance that can be used to chain operations
3819
- */
3820
- stats(callback: (err: Error, stats: Stats) => void): Sharp;
3821
-
3822
- /**
3823
- * Access to pixel-derived image statistics for every channel in the image.
3824
- * @returns A promise that resolves with a stats object
3825
- */
3826
- stats(): Promise<Stats>;
3827
-
3828
- //#endregion
3829
-
3830
- //#region Operation functions
3831
-
3832
- /**
3833
- * Rotate the output image by either an explicit angle
3834
- * or auto-orient based on the EXIF `Orientation` tag.
3835
- *
3836
- * If an angle is provided, it is converted to a valid positive degree rotation.
3837
- * For example, `-450` will produce a 270 degree rotation.
3838
- *
3839
- * When rotating by an angle other than a multiple of 90,
3840
- * the background colour can be provided with the `background` option.
3841
- *
3842
- * If no angle is provided, it is determined from the EXIF data.
3843
- * Mirroring is supported and may infer the use of a flip operation.
3844
- *
3845
- * The use of `rotate` without an angle will remove the EXIF `Orientation` tag, if any.
3846
- *
3847
- * Only one rotation can occur per pipeline (aside from an initial call without
3848
- * arguments to orient via EXIF data). Previous calls to `rotate` in the same
3849
- * pipeline will be ignored.
3850
- *
3851
- * Multi-page images can only be rotated by 180 degrees.
3852
- *
3853
- * Method order is important when rotating, resizing and/or extracting regions,
3854
- * for example `.rotate(x).extract(y)` will produce a different result to `.extract(y).rotate(x)`.
3855
- *
3856
- * @example
3857
- * const pipeline = sharp()
3858
- * .rotate()
3859
- * .resize(null, 200)
3860
- * .toBuffer(function (err, outputBuffer, info) {
3861
- * // outputBuffer contains 200px high JPEG image data,
3862
- * // auto-rotated using EXIF Orientation tag
3863
- * // info.width and info.height contain the dimensions of the resized image
3864
- * });
3865
- * readableStream.pipe(pipeline);
3866
- *
3867
- * @example
3868
- * const rotateThenResize = await sharp(input)
3869
- * .rotate(90)
3870
- * .resize({ width: 16, height: 8, fit: 'fill' })
3871
- * .toBuffer();
3872
- * const resizeThenRotate = await sharp(input)
3873
- * .resize({ width: 16, height: 8, fit: 'fill' })
3874
- * .rotate(90)
3875
- * .toBuffer();
3876
- *
3877
- * @param {number} [angle=auto] angle of rotation.
3878
- * @param {Object} [options] - if present, is an Object with optional attributes.
3879
- * @param {string|Object} [options.background="#000000"] parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha.
3880
- * @returns {Sharp}
3881
- * @throws {Error} Invalid parameters
3882
- */
3883
- rotate(angle?: number, options?: RotateOptions): Sharp;
3884
-
3885
- /**
3886
- * Alias for calling `rotate()` with no arguments, which orients the image based
3887
- * on EXIF orientsion.
3888
- *
3889
- * This operation is aliased to emphasize its purpose, helping to remove any
3890
- * confusion between rotation and orientation.
3891
- *
3892
- * @example
3893
- * const output = await sharp(input).autoOrient().toBuffer();
3894
- *
3895
- * @returns {Sharp}
3896
- */
3897
- autoOrient(): Sharp
3898
-
3899
- /**
3900
- * Flip the image about the vertical Y axis. This always occurs after rotation, if any.
3901
- * The use of flip implies the removal of the EXIF Orientation tag, if any.
3902
- * @param flip true to enable and false to disable (defaults to true)
3903
- * @returns A sharp instance that can be used to chain operations
3904
- */
3905
- flip(flip?: boolean): Sharp;
3906
-
3907
- /**
3908
- * Flop the image about the horizontal X axis. This always occurs after rotation, if any.
3909
- * The use of flop implies the removal of the EXIF Orientation tag, if any.
3910
- * @param flop true to enable and false to disable (defaults to true)
3911
- * @returns A sharp instance that can be used to chain operations
3912
- */
3913
- flop(flop?: boolean): Sharp;
3914
-
3915
- /**
3916
- * Perform an affine transform on an image. This operation will always occur after resizing, extraction and rotation, if any.
3917
- * You must provide an array of length 4 or a 2x2 affine transformation matrix.
3918
- * By default, new pixels are filled with a black background. You can provide a background colour with the `background` option.
3919
- * A particular interpolator may also be specified. Set the `interpolator` option to an attribute of the `sharp.interpolators` Object e.g. `sharp.interpolators.nohalo`.
3920
- *
3921
- * In the case of a 2x2 matrix, the transform is:
3922
- * X = matrix[0, 0] * (x + idx) + matrix[0, 1] * (y + idy) + odx
3923
- * Y = matrix[1, 0] * (x + idx) + matrix[1, 1] * (y + idy) + ody
3924
- *
3925
- * where:
3926
- *
3927
- * x and y are the coordinates in input image.
3928
- * X and Y are the coordinates in output image.
3929
- * (0,0) is the upper left corner.
3930
- *
3931
- * @param matrix Affine transformation matrix, may either by a array of length four or a 2x2 matrix array
3932
- * @param options if present, is an Object with optional attributes.
3933
- *
3934
- * @returns A sharp instance that can be used to chain operations
3935
- */
3936
- affine(matrix: [number, number, number, number] | Matrix2x2, options?: AffineOptions): Sharp;
3937
-
3938
- /**
3939
- * Sharpen the image.
3940
- * When used without parameters, performs a fast, mild sharpen of the output image.
3941
- * When a sigma is provided, performs a slower, more accurate sharpen of the L channel in the LAB colour space.
3942
- * Fine-grained control over the level of sharpening in "flat" (m1) and "jagged" (m2) areas is available.
3943
- * @param options if present, is an Object with optional attributes
3944
- * @throws {Error} Invalid parameters
3945
- * @returns A sharp instance that can be used to chain operations
3946
- */
3947
- sharpen(options?: SharpenOptions): Sharp;
3948
-
3949
- /**
3950
- * Apply median filter. When used without parameters the default window is 3x3.
3951
- * @param size square mask size: size x size (optional, default 3)
3952
- * @throws {Error} Invalid parameters
3953
- * @returns A sharp instance that can be used to chain operations
3954
- */
3955
- median(size?: number): Sharp;
3956
-
3957
- /**
3958
- * Blur the image.
3959
- * When used without parameters, performs a fast, mild blur of the output image.
3960
- * When a sigma is provided, performs a slower, more accurate Gaussian blur.
3961
- * When a boolean sigma is provided, ether blur mild or disable blur
3962
- * @param sigma a value between 0.3 and 1000 representing the sigma of the Gaussian mask, where sigma = 1 + radius / 2.
3963
- * @throws {Error} Invalid parameters
3964
- * @returns A sharp instance that can be used to chain operations
3965
- */
3966
- blur(sigma?: number | boolean | BlurOptions): Sharp;
3967
-
3968
- /**
3969
- * Expand foreground objects using the dilate morphological operator.
3970
- * @param {Number} [width=1] dilation width in pixels.
3971
- * @throws {Error} Invalid parameters
3972
- * @returns A sharp instance that can be used to chain operations
3973
- */
3974
- dilate(width?: number): Sharp;
3975
-
3976
- /**
3977
- * Shrink foreground objects using the erode morphological operator.
3978
- * @param {Number} [width=1] erosion width in pixels.
3979
- * @throws {Error} Invalid parameters
3980
- * @returns A sharp instance that can be used to chain operations
3981
- */
3982
- erode(width?: number): Sharp;
3983
-
3984
- /**
3985
- * Merge alpha transparency channel, if any, with background.
3986
- * @param flatten true to enable and false to disable (defaults to true)
3987
- * @returns A sharp instance that can be used to chain operations
3988
- */
3989
- flatten(flatten?: boolean | FlattenOptions): Sharp;
3990
-
3991
- /**
3992
- * Ensure the image has an alpha channel with all white pixel values made fully transparent.
3993
- * Existing alpha channel values for non-white pixels remain unchanged.
3994
- * @returns A sharp instance that can be used to chain operations
3995
- */
3996
- unflatten(): Sharp;
3997
-
3998
- /**
3999
- * Apply a gamma correction by reducing the encoding (darken) pre-resize at a factor of 1/gamma then increasing the encoding (brighten) post-resize at a factor of gamma.
4000
- * This can improve the perceived brightness of a resized image in non-linear colour spaces.
4001
- * JPEG and WebP input images will not take advantage of the shrink-on-load performance optimisation when applying a gamma correction.
4002
- * Supply a second argument to use a different output gamma value, otherwise the first value is used in both cases.
4003
- * @param gamma value between 1.0 and 3.0. (optional, default 2.2)
4004
- * @param gammaOut value between 1.0 and 3.0. (optional, defaults to same as gamma)
4005
- * @throws {Error} Invalid parameters
4006
- * @returns A sharp instance that can be used to chain operations
4007
- */
4008
- gamma(gamma?: number, gammaOut?: number): Sharp;
4009
-
4010
- /**
4011
- * Produce the "negative" of the image.
4012
- * @param negate true to enable and false to disable, or an object of options (defaults to true)
4013
- * @returns A sharp instance that can be used to chain operations
4014
- */
4015
- negate(negate?: boolean | NegateOptions): Sharp;
4016
-
4017
- /**
4018
- * Enhance output image contrast by stretching its luminance to cover a full dynamic range.
4019
- *
4020
- * Uses a histogram-based approach, taking a default range of 1% to 99% to reduce sensitivity to noise at the extremes.
4021
- *
4022
- * Luminance values below the `lower` percentile will be underexposed by clipping to zero.
4023
- * Luminance values above the `upper` percentile will be overexposed by clipping to the max pixel value.
4024
- *
4025
- * @param normalise options
4026
- * @throws {Error} Invalid parameters
4027
- * @returns A sharp instance that can be used to chain operations
4028
- */
4029
- normalise(normalise?: NormaliseOptions): Sharp;
4030
-
4031
- /**
4032
- * Alternative spelling of normalise.
4033
- * @param normalize options
4034
- * @throws {Error} Invalid parameters
4035
- * @returns A sharp instance that can be used to chain operations
4036
- */
4037
- normalize(normalize?: NormaliseOptions): Sharp;
4038
-
4039
- /**
4040
- * Perform contrast limiting adaptive histogram equalization (CLAHE)
4041
- *
4042
- * This will, in general, enhance the clarity of the image by bringing out
4043
- * darker details. Please read more about CLAHE here:
4044
- * https://en.wikipedia.org/wiki/Adaptive_histogram_equalization#Contrast_Limited_AHE
4045
- *
4046
- * @param options clahe options
4047
- */
4048
- clahe(options: ClaheOptions): Sharp;
4049
-
4050
- /**
4051
- * Convolve the image with the specified kernel.
4052
- * @param kernel the specified kernel
4053
- * @throws {Error} Invalid parameters
4054
- * @returns A sharp instance that can be used to chain operations
4055
- */
4056
- convolve(kernel: Kernel): Sharp;
4057
-
4058
- /**
4059
- * Any pixel value greather than or equal to the threshold value will be set to 255, otherwise it will be set to 0.
4060
- * @param threshold a value in the range 0-255 representing the level at which the threshold will be applied. (optional, default 128)
4061
- * @param options threshold options
4062
- * @throws {Error} Invalid parameters
4063
- * @returns A sharp instance that can be used to chain operations
4064
- */
4065
- threshold(threshold?: number, options?: ThresholdOptions): Sharp;
4066
-
4067
- /**
4068
- * Perform a bitwise boolean operation with operand image.
4069
- * This operation creates an output image where each pixel is the result of the selected bitwise boolean operation between the corresponding pixels of the input images.
4070
- * @param operand Buffer containing image data or String containing the path to an image file.
4071
- * @param operator one of "and", "or" or "eor" to perform that bitwise operation, like the C logic operators &, | and ^ respectively.
4072
- * @param options describes operand when using raw pixel data.
4073
- * @throws {Error} Invalid parameters
4074
- * @returns A sharp instance that can be used to chain operations
4075
- */
4076
- boolean(operand: string | Buffer, operator: keyof BoolEnum, options?: { raw: Raw }): Sharp;
4077
-
4078
- /**
4079
- * Apply the linear formula a * input + b to the image (levels adjustment)
4080
- * @param a multiplier (optional, default 1.0)
4081
- * @param b offset (optional, default 0.0)
4082
- * @throws {Error} Invalid parameters
4083
- * @returns A sharp instance that can be used to chain operations
4084
- */
4085
- linear(a?: number | number[] | null, b?: number | number[]): Sharp;
4086
-
4087
- /**
4088
- * Recomb the image with the specified matrix.
4089
- * @param inputMatrix 3x3 Recombination matrix or 4x4 Recombination matrix
4090
- * @throws {Error} Invalid parameters
4091
- * @returns A sharp instance that can be used to chain operations
4092
- */
4093
- recomb(inputMatrix: Matrix3x3 | Matrix4x4): Sharp;
4094
-
4095
- /**
4096
- * Transforms the image using brightness, saturation, hue rotation and lightness.
4097
- * Brightness and lightness both operate on luminance, with the difference being that brightness is multiplicative whereas lightness is additive.
4098
- * @param options describes the modulation
4099
- * @returns A sharp instance that can be used to chain operations
4100
- */
4101
- modulate(options?: {
4102
- brightness?: number | undefined;
4103
- saturation?: number | undefined;
4104
- hue?: number | undefined;
4105
- lightness?: number | undefined;
4106
- }): Sharp;
4107
-
4108
- //#endregion
4109
-
4110
- //#region Output functions
4111
-
4112
- /**
4113
- * Write output image data to a file.
4114
- * If an explicit output format is not selected, it will be inferred from the extension, with JPEG, PNG, WebP, AVIF, TIFF, DZI, and libvips' V format supported.
4115
- * Note that raw pixel data is only supported for buffer output.
4116
- * @param fileOut The path to write the image data to.
4117
- * @param callback Callback function called on completion with two arguments (err, info). info contains the output image format, size (bytes), width, height and channels.
4118
- * @throws {Error} Invalid parameters
4119
- * @returns A sharp instance that can be used to chain operations
4120
- */
4121
- toFile(fileOut: string, callback: (err: Error, info: OutputInfo) => void): Sharp;
4122
-
4123
- /**
4124
- * Write output image data to a file.
4125
- * @param fileOut The path to write the image data to.
4126
- * @throws {Error} Invalid parameters
4127
- * @returns A promise that fulfills with an object containing information on the resulting file
4128
- */
4129
- toFile(fileOut: string): Promise<OutputInfo>;
4130
-
4131
- /**
4132
- * Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
4133
- * By default, the format will match the input image, except SVG input which becomes PNG output.
4134
- * @param callback Callback function called on completion with three arguments (err, buffer, info).
4135
- * @returns A sharp instance that can be used to chain operations
4136
- */
4137
- toBuffer(callback: (err: Error, buffer: Buffer, info: OutputInfo) => void): Sharp;
4138
-
4139
- /**
4140
- * Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
4141
- * By default, the format will match the input image, except SVG input which becomes PNG output.
4142
- * @param options resolve options
4143
- * @param options.resolveWithObject Resolve the Promise with an Object containing data and info properties instead of resolving only with data.
4144
- * @returns A promise that resolves with the Buffer data.
4145
- */
4146
- toBuffer(options?: { resolveWithObject: false }): Promise<Buffer>;
4147
-
4148
- /**
4149
- * Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
4150
- * By default, the format will match the input image, except SVG input which becomes PNG output.
4151
- * @param options resolve options
4152
- * @param options.resolveWithObject Resolve the Promise with an Object containing data and info properties instead of resolving only with data.
4153
- * @returns A promise that resolves with an object containing the Buffer data and an info object containing the output image format, size (bytes), width, height and channels
4154
- */
4155
- toBuffer(options: { resolveWithObject: true }): Promise<{ data: Buffer; info: OutputInfo }>;
4156
-
4157
- /**
4158
- * Write output to a Uint8Array backed by a transferable ArrayBuffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
4159
- * By default, the format will match the input image, except SVG input which becomes PNG output.
4160
- * @returns A promise that resolves with an object containing the Uint8Array data and an info object containing the output image format, size (bytes), width, height and channels
4161
- */
4162
- toUint8Array(): Promise<{ data: Uint8Array; info: OutputInfo }>;
4163
-
4164
- /**
4165
- * Set output density (DPI) in EXIF metadata.
4166
- * @param density Density in dots per inch (DPI).
4167
- * @returns A sharp instance that can be used to chain operations
4168
- * @throws {Error} Invalid parameters
4169
- */
4170
- withDensity(density: number): Sharp;
4171
-
4172
- /**
4173
- * Keep all EXIF metadata from the input image in the output image.
4174
- * EXIF metadata is unsupported for TIFF output.
4175
- * @returns A sharp instance that can be used to chain operations
4176
- */
4177
- keepExif(): Sharp;
4178
-
4179
- /**
4180
- * Set EXIF metadata in the output image, ignoring any EXIF in the input image.
4181
- * @param {Exif} exif Object keyed by IFD0, IFD1 etc. of key/value string pairs to write as EXIF data.
4182
- * @returns A sharp instance that can be used to chain operations
4183
- * @throws {Error} Invalid parameters
4184
- */
4185
- withExif(exif: Exif): Sharp;
4186
-
4187
- /**
4188
- * Update EXIF metadata from the input image in the output image.
4189
- * @param {Exif} exif Object keyed by IFD0, IFD1 etc. of key/value string pairs to write as EXIF data.
4190
- * @returns A sharp instance that can be used to chain operations
4191
- * @throws {Error} Invalid parameters
4192
- */
4193
- withExifMerge(exif: Exif): Sharp;
4194
-
4195
- /**
4196
- * Keep ICC profile from the input image in the output image where possible.
4197
- * @returns A sharp instance that can be used to chain operations
4198
- */
4199
- keepIccProfile(): Sharp;
4200
-
4201
- /**
4202
- * Transform using an ICC profile and attach to the output image.
4203
- * @param {string} icc - Absolute filesystem path to output ICC profile or built-in profile name (srgb, p3, cmyk).
4204
- * @returns A sharp instance that can be used to chain operations
4205
- * @throws {Error} Invalid parameters
4206
- */
4207
- withIccProfile(icc: string, options?: WithIccProfileOptions): Sharp;
4208
-
4209
- /**
4210
- * Keep all XMP metadata from the input image in the output image.
4211
- * @returns A sharp instance that can be used to chain operations
4212
- */
4213
- keepXmp(): Sharp;
4214
-
4215
- /**
4216
- * Set XMP metadata in the output image.
4217
- * @param {string} xmp - String containing XMP metadata to be embedded in the output image.
4218
- * @returns A sharp instance that can be used to chain operations
4219
- * @throws {Error} Invalid parameters
4220
- */
4221
- withXmp(xmp: string): Sharp;
4222
-
4223
- /**
4224
- * Include all metadata (EXIF, XMP, IPTC) from the input image in the output image.
4225
- * The default behaviour, when withMetadata is not used, is to strip all metadata and convert to the device-independent sRGB colour space.
4226
- * This will also convert to and add a web-friendly sRGB ICC profile.
4227
- * @param withMetadata
4228
- * @throws {Error} Invalid parameters.
4229
- */
4230
- withMetadata(withMetadata?: WriteableMetadata): Sharp;
4231
-
4232
- /**
4233
- * Use these JPEG options for output image.
4234
- * @param options Output options.
4235
- * @throws {Error} Invalid options
4236
- * @returns A sharp instance that can be used to chain operations
4237
- */
4238
- jpeg(options?: JpegOptions): Sharp;
4239
-
4240
- /**
4241
- * Use these JP2 (JPEG 2000) options for output image.
4242
- * @param options Output options.
4243
- * @throws {Error} Invalid options
4244
- * @returns A sharp instance that can be used to chain operations
4245
- */
4246
- jp2(options?: Jp2Options): Sharp;
4247
-
4248
- /**
4249
- * Use these JPEG-XL (JXL) options for output image.
4250
- * This feature is experimental, please do not use in production systems.
4251
- * Requires libvips compiled with support for libjxl.
4252
- * The prebuilt binaries do not include this.
4253
- * Image metadata (EXIF, XMP) is unsupported.
4254
- * @param options Output options.
4255
- * @throws {Error} Invalid options
4256
- * @returns A sharp instance that can be used to chain operations
4257
- */
4258
- jxl(options?: JxlOptions): Sharp;
4259
-
4260
- /**
4261
- * Use these PNG options for output image.
4262
- * PNG output is always full colour at 8 or 16 bits per pixel.
4263
- * Indexed PNG input at 1, 2 or 4 bits per pixel is converted to 8 bits per pixel.
4264
- * @param options Output options.
4265
- * @throws {Error} Invalid options
4266
- * @returns A sharp instance that can be used to chain operations
4267
- */
4268
- png(options?: PngOptions): Sharp;
4269
-
4270
- /**
4271
- * Use these WebP options for output image.
4272
- * @param options Output options.
4273
- * @throws {Error} Invalid options
4274
- * @returns A sharp instance that can be used to chain operations
4275
- */
4276
- webp(options?: WebpOptions): Sharp;
4277
-
4278
- /**
4279
- * Use these GIF options for output image.
4280
- * Requires libvips compiled with support for ImageMagick or GraphicsMagick. The prebuilt binaries do not include this - see installing a custom libvips.
4281
- * @param options Output options.
4282
- * @throws {Error} Invalid options
4283
- * @returns A sharp instance that can be used to chain operations
4284
- */
4285
- gif(options?: GifOptions): Sharp;
4286
-
4287
- /**
4288
- * Use these AVIF options for output image.
4289
- * @param options Output options.
4290
- * @throws {Error} Invalid options
4291
- * @returns A sharp instance that can be used to chain operations
4292
- */
4293
- avif(options?: AvifOptions): Sharp;
4294
-
4295
- /**
4296
- * Use these HEIF options for output image.
4297
- * Support for patent-encumbered HEIC images requires the use of a globally-installed libvips compiled with support for libheif, libde265 and x265.
4298
- * @param options Output options.
4299
- * @throws {Error} Invalid options
4300
- * @returns A sharp instance that can be used to chain operations
4301
- */
4302
- heif(options?: HeifOptions): Sharp;
4303
-
4304
- /**
4305
- * Use these TIFF options for output image.
4306
- * @param options Output options.
4307
- * @throws {Error} Invalid options
4308
- * @returns A sharp instance that can be used to chain operations
4309
- */
4310
- tiff(options?: TiffOptions): Sharp;
4311
-
4312
- /**
4313
- * Force output to be raw, uncompressed uint8 pixel data.
4314
- * @param options Raw output options.
4315
- * @throws {Error} Invalid options
4316
- * @returns A sharp instance that can be used to chain operations
4317
- */
4318
- raw(options?: RawOptions): Sharp;
4319
-
4320
- /**
4321
- * Force output to a given format.
4322
- * @param format a String or an Object with an 'id' attribute
4323
- * @param options output options
4324
- * @throws {Error} Unsupported format or options
4325
- * @returns A sharp instance that can be used to chain operations
4326
- */
4327
- toFormat(
4328
- format: keyof FormatEnum | AvailableFormatInfo | "avif",
4329
- options?:
4330
- | OutputOptions
4331
- | JpegOptions
4332
- | PngOptions
4333
- | WebpOptions
4334
- | AvifOptions
4335
- | HeifOptions
4336
- | JxlOptions
4337
- | GifOptions
4338
- | Jp2Options
4339
- | RawOptions
4340
- | TiffOptions,
4341
- ): Sharp;
4342
-
4343
- /**
4344
- * Use tile-based deep zoom (image pyramid) output.
4345
- * Set the format and options for tile images via the toFormat, jpeg, png or webp functions.
4346
- * Use a .zip or .szi file extension with toFile to write to a compressed archive file format.
4347
- * @param tile tile options
4348
- * @throws {Error} Invalid options
4349
- * @returns A sharp instance that can be used to chain operations
4350
- */
4351
- tile(tile?: TileOptions): Sharp;
4352
-
4353
- /**
4354
- * Set a timeout for processing, in seconds. Use a value of zero to continue processing indefinitely, the default behaviour.
4355
- * The clock starts when libvips opens an input image for processing. Time spent waiting for a libuv thread to become available is not included.
4356
- * @param options Object with a `seconds` attribute between 0 and 3600 (number)
4357
- * @throws {Error} Invalid options
4358
- * @returns A sharp instance that can be used to chain operations
4359
- */
4360
- timeout(options: TimeoutOptions): Sharp;
4361
-
4362
- //#endregion
4363
-
4364
- //#region Resize functions
4365
-
4366
- /**
4367
- * Resize image to width, height or width x height.
4368
- *
4369
- * When both a width and height are provided, the possible methods by which the image should fit these are:
4370
- * - cover: Crop to cover both provided dimensions (the default).
4371
- * - contain: Embed within both provided dimensions.
4372
- * - fill: Ignore the aspect ratio of the input and stretch to both provided dimensions.
4373
- * - inside: Preserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to both those specified.
4374
- * - outside: Preserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to both those specified.
4375
- * Some of these values are based on the object-fit CSS property.
4376
- *
4377
- * When using a fit of cover or contain, the default position is centre. Other options are:
4378
- * - sharp.position: top, right top, right, right bottom, bottom, left bottom, left, left top.
4379
- * - sharp.gravity: north, northeast, east, southeast, south, southwest, west, northwest, center or centre.
4380
- * - sharp.strategy: cover only, dynamically crop using either the entropy or attention strategy. Some of these values are based on the object-position CSS property.
4381
- *
4382
- * The strategy-based approach resizes so one dimension is at its target length then repeatedly ranks edge regions,
4383
- * discarding the edge with the lowest score based on the selected strategy.
4384
- * - entropy: focus on the region with the highest Shannon entropy.
4385
- * - attention: focus on the region with the highest luminance frequency, colour saturation and presence of skin tones.
4386
- *
4387
- * Possible interpolation kernels are:
4388
- * - nearest: Use nearest neighbour interpolation.
4389
- * - cubic: Use a Catmull-Rom spline.
4390
- * - lanczos2: Use a Lanczos kernel with a=2.
4391
- * - lanczos3: Use a Lanczos kernel with a=3 (the default).
4392
- *
4393
- * @param width pixels wide the resultant image should be. Use null or undefined to auto-scale the width to match the height.
4394
- * @param height pixels high the resultant image should be. Use null or undefined to auto-scale the height to match the width.
4395
- * @param options resize options
4396
- * @throws {Error} Invalid parameters
4397
- * @returns A sharp instance that can be used to chain operations
4398
- */
4399
- resize(widthOrOptions?: number | ResizeOptions | null, height?: number | null, options?: ResizeOptions): Sharp;
4400
-
4401
- /**
4402
- * Shorthand for resize(null, null, options);
4403
- *
4404
- * @param options resize options
4405
- * @throws {Error} Invalid parameters
4406
- * @returns A sharp instance that can be used to chain operations
4407
- */
4408
- resize(options: ResizeOptions): Sharp;
4409
-
4410
- /**
4411
- * Extend / pad / extrude one or more edges of the image with either
4412
- * the provided background colour or pixels derived from the image.
4413
- * This operation will always occur after resizing and extraction, if any.
4414
- * @param extend single pixel count to add to all edges or an Object with per-edge counts
4415
- * @throws {Error} Invalid parameters
4416
- * @returns A sharp instance that can be used to chain operations
4417
- */
4418
- extend(extend: number | ExtendOptions): Sharp;
4419
-
4420
- /**
4421
- * Extract a region of the image.
4422
- * - Use extract() before resize() for pre-resize extraction.
4423
- * - Use extract() after resize() for post-resize extraction.
4424
- * - Use extract() before and after for both.
4425
- *
4426
- * @param region The region to extract
4427
- * @throws {Error} Invalid parameters
4428
- * @returns A sharp instance that can be used to chain operations
4429
- */
4430
- extract(region: Region): Sharp;
4431
-
4432
- /**
4433
- * Trim pixels from all edges that contain values similar to the given background colour, which defaults to that of the top-left pixel.
4434
- * Images with an alpha channel will use the combined bounding box of alpha and non-alpha channels.
4435
- * The info response Object will contain trimOffsetLeft and trimOffsetTop properties.
4436
- * @param options trim options
4437
- * @throws {Error} Invalid parameters
4438
- * @returns A sharp instance that can be used to chain operations
4439
- */
4440
- trim(options?: TrimOptions): Sharp;
4441
-
4442
- //#endregion
4443
- }
4444
-
4445
- type SharpInput = Buffer
4446
- | ArrayBuffer
4447
- | Uint8Array
4448
- | Uint8ClampedArray
4449
- | Int8Array
4450
- | Uint16Array
4451
- | Int16Array
4452
- | Uint32Array
4453
- | Int32Array
4454
- | Float32Array
4455
- | Float64Array
4456
- | string;
4457
-
4458
- interface SharpOptions {
4459
- /**
4460
- * Auto-orient based on the EXIF `Orientation` tag, if present.
4461
- * Mirroring is supported and may infer the use of a flip operation.
4462
- *
4463
- * Using this option will remove the EXIF `Orientation` tag, if any.
4464
- */
4465
- autoOrient?: boolean | undefined;
4466
- /**
4467
- * When to abort processing of invalid pixel data, one of (in order of sensitivity):
4468
- * 'none' (least), 'truncated', 'error' or 'warning' (most), highers level imply lower levels, invalid metadata will always abort.
4469
- * Use the default 'warning' level with untrusted input. (optional, default 'warning')
4470
- */
4471
- failOn?: FailOnOptions | undefined;
4472
- /**
4473
- * Do not process input images where the number of pixels (width x height) exceeds this limit.
4474
- * Assumes image dimensions contained in the input metadata can be trusted.
4475
- * An integral Number of pixels, zero or false to remove limit, true to use default limit of 268402689 (0x3FFF x 0x3FFF). (optional, default 268402689)
4476
- */
4477
- limitInputPixels?: number | boolean | undefined;
4478
- /**
4479
- * Do not process input images where the number of channels exceeds this limit.
4480
- * Assumes image metadata can be trusted.
4481
- * An integral Number of channels, zero or false to remove limit, true to use default limit of 5. (optional, default 5)
4482
- */
4483
- limitInputChannels?: number | boolean | undefined;
4484
- /** Set this to true to remove safety features that help prevent memory exhaustion (SVG, PNG). (optional, default false) */
4485
- unlimited?: boolean | undefined;
4486
- /** Set this to false to use random access rather than sequential read. Some operations will do this automatically. */
4487
- sequentialRead?: boolean | undefined;
4488
- /** The DPI at which to render SVG and PDF images, in the range 1 to 100000. (optional, default 72) */
4489
- density?: number | undefined;
4490
- /** Should the embedded ICC profile, if any, be ignored. */
4491
- ignoreIcc?: boolean | undefined;
4492
- /** Number of pages to extract for multi-page input (GIF, TIFF, PDF), use -1 for all pages */
4493
- pages?: number | undefined;
4494
- /** Page number to start extracting from for multi-page input (GIF, TIFF, PDF), zero based. (optional, default 0) */
4495
- page?: number | undefined;
4496
- /** TIFF specific input options */
4497
- tiff?: TiffInputOptions | undefined;
4498
- /** SVG specific input options */
4499
- svg?: SvgInputOptions | undefined;
4500
- /** PDF specific input options */
4501
- pdf?: PdfInputOptions | undefined;
4502
- /** OpenSlide specific input options */
4503
- openSlide?: OpenSlideInputOptions | undefined;
4504
- /** JPEG 2000 specific input options */
4505
- jp2?: Jp2InputOptions | undefined;
4506
- /** @deprecated Use {@link SharpOptions.tiff} instead */
4507
- subifd?: number | undefined;
4508
- /** @deprecated Use {@link SharpOptions.pdf} instead */
4509
- pdfBackground?: ColorLike | undefined;
4510
- /** @deprecated Use {@link SharpOptions.openSlide} instead */
4511
- level?: number | undefined;
4512
- /** Set to `true` to read all frames/pages of an animated image (equivalent of setting `pages` to `-1`). (optional, default false) */
4513
- animated?: boolean | undefined;
4514
- /** Describes raw pixel input image data. See raw() for pixel ordering. */
4515
- raw?: CreateRaw | undefined;
4516
- /** Describes a new image to be created. */
4517
- create?: Create | undefined;
4518
- /** Describes a new text image to be created. */
4519
- text?: CreateText | undefined;
4520
- /** Describes how array of input images should be joined. */
4521
- join?: Join | undefined;
4522
- }
4523
-
4524
- interface CacheOptions {
4525
- /** Is the maximum memory in MB to use for this cache (optional, default 50) */
4526
- memory?: number | undefined;
4527
- /** Is the maximum number of files to hold open (optional, default 20) */
4528
- files?: number | undefined;
4529
- /** Is the maximum number of operations to cache (optional, default 100) */
4530
- items?: number | undefined;
4531
- }
4532
-
4533
- interface TimeoutOptions {
4534
- /** Number of seconds after which processing will be stopped (default 0, eg disabled) */
4535
- seconds: number;
4536
- }
4537
-
4538
- interface SharpCounters {
4539
- /** The number of tasks this module has queued waiting for libuv to provide a worker thread from its pool. */
4540
- queue: number;
4541
- /** The number of resize tasks currently being processed. */
4542
- process: number;
4543
- }
4544
-
4545
- interface Raw {
4546
- width: number;
4547
- height: number;
4548
- channels: Channels;
4549
- }
4550
-
4551
- interface CreateRaw extends Raw {
4552
- /** Specifies that the raw input has already been premultiplied, set to true to avoid sharp premultiplying the image. (optional, default false) */
4553
- premultiplied?: boolean | undefined;
4554
- /** The height of each page/frame for animated images, must be an integral factor of the overall image height. */
4555
- pageHeight?: number | undefined;
4556
- }
4557
-
4558
- type CreateChannels = 3 | 4;
4559
-
4560
- interface Create {
4561
- /** Number of pixels wide. */
4562
- width: number;
4563
- /** Number of pixels high. */
4564
- height: number;
4565
- /** Number of bands, 3 for RGB, 4 for RGBA */
4566
- channels: CreateChannels;
4567
- /** Parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha. */
4568
- background: ColorLike;
4569
- /** Describes a noise to be created. */
4570
- noise?: Noise | undefined;
4571
- /** The height of each page/frame for animated images, must be an integral factor of the overall image height. */
4572
- pageHeight?: number | undefined;
4573
-
4574
- }
4575
-
4576
- interface CreateText {
4577
- /** Text to render as a UTF-8 string. It can contain Pango markup, for example `<i>Le</i>Monde`. */
4578
- text: string;
4579
- /** Font name to render with. */
4580
- font?: string;
4581
- /** Absolute filesystem path to a font file that can be used by `font`. */
4582
- fontfile?: string;
4583
- /** Integral number of pixels to word-wrap at. Lines of text wider than this will be broken at word boundaries. (optional, default `0`) */
4584
- width?: number;
4585
- /**
4586
- * Integral number of pixels high. When defined, `dpi` will be ignored and the text will automatically fit the pixel resolution
4587
- * defined by `width` and `height`. Will be ignored if `width` is not specified or set to 0. (optional, default `0`)
4588
- */
4589
- height?: number;
4590
- /** Text alignment ('left', 'centre', 'center', 'right'). (optional, default 'left') */
4591
- align?: TextAlign;
4592
- /** Set this to true to apply justification to the text. (optional, default `false`) */
4593
- justify?: boolean;
4594
- /** The resolution (size) at which to render the text. Does not take effect if `height` is specified. (optional, default `72`) */
4595
- dpi?: number;
4596
- /**
4597
- * Set this to true to enable RGBA output. This is useful for colour emoji rendering,
4598
- * or support for pango markup features like `<span foreground="red">Red!</span>`. (optional, default `false`)
4599
- */
4600
- rgba?: boolean;
4601
- /** Text line height in points. Will use the font line height if none is specified. (optional, default `0`) */
4602
- spacing?: number;
4603
- /** Word wrapping style when width is provided, one of: 'word', 'char', 'word-char' (prefer word, fallback to char) or 'none' */
4604
- wrap?: TextWrap;
4605
- }
4606
-
4607
- interface Join {
4608
- /** Number of images per row. */
4609
- across?: number | undefined;
4610
- /** Treat input as frames of an animated image. */
4611
- animated?: boolean | undefined;
4612
- /** Space between images, in pixels. */
4613
- shim?: number | undefined;
4614
- /** Background colour. */
4615
- background?: ColorLike | undefined;
4616
- /** Horizontal alignment. */
4617
- halign?: HorizontalAlignment | undefined;
4618
- /** Vertical alignment. */
4619
- valign?: VerticalAlignment | undefined;
4620
- }
4621
-
4622
- interface TiffInputOptions {
4623
- /** Sub Image File Directory to extract, defaults to main image. Use -1 for all subifds. */
4624
- subifd?: number | undefined;
4625
- }
4626
-
4627
- interface SvgInputOptions {
4628
- /** Custom CSS for SVG input, applied with a User Origin during the CSS cascade. */
4629
- stylesheet?: string | undefined;
4630
- /** Set to `true` to render SVG input at 32-bits per channel (128-bit) instead of 8-bits per channel (32-bit) RGBA. */
4631
- highBitdepth?: boolean | undefined;
4632
- }
4633
-
4634
- interface PdfInputOptions {
4635
- /** Background colour to use when PDF is partially transparent. Requires the use of a globally-installed libvips compiled with support for PDFium, Poppler, ImageMagick or GraphicsMagick. */
4636
- background?: ColorLike | undefined;
4637
- }
4638
-
4639
- interface OpenSlideInputOptions {
4640
- /** Level to extract from a multi-level input, zero based. (optional, default 0) */
4641
- level?: number | undefined;
4642
- }
4643
-
4644
- interface Jp2InputOptions {
4645
- /** Set to `true` to load JPEG 2000 images using [oneshot mode](https://github.com/libvips/libvips/issues/4205) */
4646
- oneshot?: boolean | undefined;
4647
- }
4648
-
4649
- interface ExifDir {
4650
- [k: string]: string;
4651
- }
4652
-
4653
- interface Exif {
4654
- 'IFD0'?: ExifDir;
4655
- 'IFD1'?: ExifDir;
4656
- 'IFD2'?: ExifDir;
4657
- 'IFD3'?: ExifDir;
4658
- }
4659
-
4660
- type HeifCompression = 'av1' | 'hevc';
4661
-
4662
- type HeifTune = 'auto' | 'iq' | 'psnr' | 'ssim';
4663
-
4664
- type Unit = 'inch' | 'cm';
4665
-
4666
- interface WriteableMetadata {
4667
- /** Number of pixels per inch (DPI) */
4668
- density?: number | undefined;
4669
- /** Value between 1 and 8, used to update the EXIF Orientation tag. */
4670
- orientation?: number | undefined;
4671
- /**
4672
- * Filesystem path to output ICC profile, defaults to sRGB.
4673
- * @deprecated Use `withIccProfile()` instead.
4674
- */
4675
- icc?: string | undefined;
4676
- /**
4677
- * Object keyed by IFD0, IFD1 etc. of key/value string pairs to write as EXIF data.
4678
- * @deprecated Use `withExif()` or `withExifMerge()` instead.
4679
- */
4680
- exif?: Exif | undefined;
4681
- }
4682
-
4683
- interface Metadata {
4684
- /** Number value of the EXIF Orientation header, if present */
4685
- orientation?: number | undefined;
4686
- /** Name of decoder used to decompress image data e.g. jpeg, png, webp, gif, svg */
4687
- format: keyof FormatEnum;
4688
- /** Total size of image in bytes, for Stream and Buffer input only */
4689
- size?: number | undefined;
4690
- /** Number of pixels wide (EXIF orientation is not taken into consideration) */
4691
- width: number;
4692
- /** Number of pixels high (EXIF orientation is not taken into consideration) */
4693
- height: number;
4694
- /** Any changed metadata after the image orientation is applied. */
4695
- autoOrient: {
4696
- /** Number of pixels wide (EXIF orientation is taken into consideration) */
4697
- width: number;
4698
- /** Number of pixels high (EXIF orientation is taken into consideration) */
4699
- height: number;
4700
- };
4701
- /** Name of colour space interpretation */
4702
- space: keyof ColourspaceEnum;
4703
- /** Number of bands e.g. 3 for sRGB, 4 for CMYK */
4704
- channels: Channels;
4705
- /** Name of pixel depth format e.g. uchar, char, ushort, float ... */
4706
- depth: keyof DepthEnum;
4707
- /** Number of pixels per inch (DPI), if present */
4708
- density?: number | undefined;
4709
- /** String containing JPEG chroma subsampling, 4:2:0 or 4:4:4 for RGB, 4:2:0:4 or 4:4:4:4 for CMYK */
4710
- chromaSubsampling?: string | undefined;
4711
- /** Boolean indicating whether the image is interlaced using a progressive scan */
4712
- isProgressive: boolean;
4713
- /** Boolean indicating whether the image is palette-based (GIF, PNG). */
4714
- isPalette: boolean;
4715
- /** Number of bits per sample for each channel (GIF, PNG). */
4716
- bitsPerSample?: number | undefined;
4717
- /** Number of pages/frames contained within the image, with support for TIFF, HEIF, PDF, animated GIF and animated WebP */
4718
- pages?: number | undefined;
4719
- /** Number of pixels high each page in a multi-page image will be. */
4720
- pageHeight?: number | undefined;
4721
- /** Number of times to loop an animated image, zero refers to a continuous loop. */
4722
- loop?: number | undefined;
4723
- /** Delay in ms between each page in an animated image, provided as an array of integers. */
4724
- delay?: number[] | undefined;
4725
- /** Number of the primary page in a HEIF image */
4726
- pagePrimary?: number | undefined;
4727
- /** Boolean indicating the presence of an embedded ICC profile */
4728
- hasProfile: boolean;
4729
- /** Boolean indicating the presence of an alpha transparency channel */
4730
- hasAlpha: boolean;
4731
- /** Buffer containing raw EXIF data, if present */
4732
- exif?: Buffer | undefined;
4733
- /** Buffer containing raw ICC profile data, if present */
4734
- icc?: Buffer | undefined;
4735
- /** Buffer containing raw IPTC data, if present */
4736
- iptc?: Buffer | undefined;
4737
- /** Buffer containing raw XMP data, if present */
4738
- xmp?: Buffer | undefined;
4739
- /** String containing XMP data, if valid UTF-8 */
4740
- xmpAsString?: string | undefined;
4741
- /** Buffer containing raw TIFFTAG_PHOTOSHOP data, if present */
4742
- tifftagPhotoshop?: Buffer | undefined;
4743
- /** The encoder used to compress an HEIF file, `av1` (AVIF) or `hevc` (HEIC) */
4744
- compression?: HeifCompression | undefined;
4745
- /** Default background colour, if present, for PNG (bKGD) and GIF images */
4746
- background?: { r: number; g: number; b: number } | { gray: number };
4747
- /** Details of each level in a multi-level image provided as an array of objects, requires libvips compiled with support for OpenSlide */
4748
- levels?: LevelMetadata[] | undefined;
4749
- /** Number of Sub Image File Directories in an OME-TIFF image */
4750
- subifds?: number | undefined;
4751
- /** The unit of resolution (density) */
4752
- resolutionUnit?: Unit | undefined;
4753
- /** String containing format for images loaded via *magick */
4754
- formatMagick?: string | undefined;
4755
- /** Array of keyword/text pairs representing PNG text blocks, if present. */
4756
- comments?: CommentsMetadata[] | undefined;
4757
- /** HDR gain map, if present */
4758
- gainMap?: GainMapMetadata | undefined;
4759
- }
4760
-
4761
- interface LevelMetadata {
4762
- width: number;
4763
- height: number;
4764
- }
4765
-
4766
- interface CommentsMetadata {
4767
- keyword: string;
4768
- text: string;
4769
- }
4770
-
4771
- interface GainMapMetadata {
4772
- /** JPEG image */
4773
- image: Buffer;
4774
- }
4775
-
4776
- interface Stats {
4777
- /** Array of channel statistics for each channel in the image. */
4778
- channels: ChannelStats[];
4779
- /** Value to identify if the image is opaque or transparent, based on the presence and use of alpha channel */
4780
- isOpaque: boolean;
4781
- /** Histogram-based estimation of greyscale entropy, discarding alpha channel if any */
4782
- entropy: number;
4783
- /** Estimation of greyscale sharpness based on the standard deviation of a Laplacian convolution, discarding alpha channel if any */
4784
- sharpness: number;
4785
- /** Object containing most dominant sRGB colour based on a 4096-bin 3D histogram */
4786
- dominant: { r: number; g: number; b: number };
4787
- }
4788
-
4789
- interface ChannelStats {
4790
- /** minimum value in the channel */
4791
- min: number;
4792
- /** maximum value in the channel */
4793
- max: number;
4794
- /** sum of all values in a channel */
4795
- sum: number;
4796
- /** sum of squared values in a channel */
4797
- squaresSum: number;
4798
- /** mean of the values in a channel */
4799
- mean: number;
4800
- /** standard deviation for the values in a channel */
4801
- stdev: number;
4802
- /** x-coordinate of one of the pixel where the minimum lies */
4803
- minX: number;
4804
- /** y-coordinate of one of the pixel where the minimum lies */
4805
- minY: number;
4806
- /** x-coordinate of one of the pixel where the maximum lies */
4807
- maxX: number;
4808
- /** y-coordinate of one of the pixel where the maximum lies */
4809
- maxY: number;
4810
- }
4811
-
4812
- interface OutputOptions {
4813
- /** Force format output, otherwise attempt to use input format (optional, default true) */
4814
- force?: boolean | undefined;
4815
- }
4816
-
4817
- interface WithIccProfileOptions {
4818
- /** Should the ICC profile be included in the output image metadata? (optional, default true) */
4819
- attach?: boolean | undefined;
4820
- }
4821
-
4822
- interface JpegOptions extends OutputOptions {
4823
- /** Quality, integer 1-100 (optional, default 80) */
4824
- quality?: number | undefined;
4825
- /** Use progressive (interlace) scan (optional, default false) */
4826
- progressive?: boolean | undefined;
4827
- /** Set to '4:4:4' to prevent chroma subsampling when quality <= 90 (optional, default '4:2:0') */
4828
- chromaSubsampling?: string | undefined;
4829
- /** Apply trellis quantisation (optional, default false) */
4830
- trellisQuantisation?: boolean | undefined;
4831
- /** Apply overshoot deringing (optional, default false) */
4832
- overshootDeringing?: boolean | undefined;
4833
- /** Optimise progressive scans, forces progressive (optional, default false) */
4834
- optimiseScans?: boolean | undefined;
4835
- /** Alternative spelling of optimiseScans (optional, default false) */
4836
- optimizeScans?: boolean | undefined;
4837
- /** Optimise Huffman coding tables (optional, default true) */
4838
- optimiseCoding?: boolean | undefined;
4839
- /** Alternative spelling of optimiseCoding (optional, default true) */
4840
- optimizeCoding?: boolean | undefined;
4841
- /** Quantization table to use, integer 0-8 (optional, default 0) */
4842
- quantisationTable?: number | undefined;
4843
- /** Alternative spelling of quantisationTable (optional, default 0) */
4844
- quantizationTable?: number | undefined;
4845
- /** Use mozjpeg defaults (optional, default false) */
4846
- mozjpeg?: boolean | undefined;
4847
- }
4848
-
4849
- interface Jp2Options extends OutputOptions {
4850
- /** Quality, integer 1-100 (optional, default 80) */
4851
- quality?: number;
4852
- /** Use lossless compression mode (optional, default false) */
4853
- lossless?: boolean;
4854
- /** Horizontal tile size (optional, default 512) */
4855
- tileWidth?: number;
4856
- /** Vertical tile size (optional, default 512) */
4857
- tileHeight?: number;
4858
- /** Set to '4:2:0' to enable chroma subsampling (optional, default '4:4:4') */
4859
- chromaSubsampling?: '4:4:4' | '4:2:0';
4860
- }
4861
-
4862
- interface JxlOptions extends OutputOptions {
4863
- /** Maximum encoding error, between 0 (highest quality) and 15 (lowest quality) (optional, default 1.0) */
4864
- distance?: number;
4865
- /** Calculate distance based on JPEG-like quality, between 1 and 100, overrides distance if specified */
4866
- quality?: number;
4867
- /** Target decode speed tier, between 0 (highest quality) and 4 (lowest quality) (optional, default 0) */
4868
- decodingTier?: number;
4869
- /** Use lossless compression (optional, default false) */
4870
- lossless?: boolean;
4871
- /** CPU effort, between 3 (fastest) and 9 (slowest) (optional, default 7) */
4872
- effort?: number | undefined;
4873
- }
4874
-
4875
- interface WebpOptions extends OutputOptions, AnimationOptions {
4876
- /** Quality, integer 1-100 (optional, default 80) */
4877
- quality?: number | undefined;
4878
- /** Quality of alpha layer, number from 0-100 (optional, default 100) */
4879
- alphaQuality?: number | undefined;
4880
- /** Use lossless compression mode (optional, default false) */
4881
- lossless?: boolean | undefined;
4882
- /** Use near_lossless compression mode (optional, default false) */
4883
- nearLossless?: boolean | undefined;
4884
- /** Use high quality chroma subsampling (optional, default false) */
4885
- smartSubsample?: boolean | undefined;
4886
- /** Auto-adjust the deblocking filter, slow but can improve low contrast edges (optional, default false) */
4887
- smartDeblock?: boolean | undefined;
4888
- /** Level of CPU effort to reduce file size, integer 0-6 (optional, default 4) */
4889
- effort?: number | undefined;
4890
- /** Prevent use of animation key frames to minimise file size (slow) (optional, default false) */
4891
- minSize?: boolean | undefined;
4892
- /** Allow mixture of lossy and lossless animation frames (slow) (optional, default false) */
4893
- mixed?: boolean | undefined;
4894
- /** Preset options: one of default, photo, picture, drawing, icon, text (optional, default 'default') */
4895
- preset?: keyof PresetEnum | undefined;
4896
- /** Preserve the colour data in transparent pixels (optional, default false) */
4897
- exact?: boolean | undefined;
4898
- }
4899
-
4900
- interface AvifOptions extends OutputOptions {
4901
- /** quality, integer 1-100 (optional, default 50) */
4902
- quality?: number | undefined;
4903
- /** use lossless compression (optional, default false) */
4904
- lossless?: boolean | undefined;
4905
- /** Level of CPU effort to reduce file size, between 0 (fastest) and 9 (slowest) (optional, default 4) */
4906
- effort?: number | undefined;
4907
- /** set to '4:2:0' to use chroma subsampling, requires libvips v8.11.0 (optional, default '4:4:4') */
4908
- chromaSubsampling?: string | undefined;
4909
- /** Set bitdepth to 8, 10 or 12 bit (optional, default 8) */
4910
- bitdepth?: 8 | 10 | 12 | undefined;
4911
- /** Tune output for a quality metric, one of 'auto', 'iq', 'psnr' or 'ssim' (optional, default 'auto') */
4912
- tune?: HeifTune | undefined;
4913
- }
4914
-
4915
- interface HeifOptions extends OutputOptions {
4916
- /** quality, integer 1-100 (optional, default 50) */
4917
- quality?: number | undefined;
4918
- /** compression format: av1, hevc (optional, default 'av1') */
4919
- compression?: HeifCompression | undefined;
4920
- /** use lossless compression (optional, default false) */
4921
- lossless?: boolean | undefined;
4922
- /** Level of CPU effort to reduce file size, between 0 (fastest) and 9 (slowest) (optional, default 4) */
4923
- effort?: number | undefined;
4924
- /** set to '4:2:0' to use chroma subsampling (optional, default '4:4:4') */
4925
- chromaSubsampling?: string | undefined;
4926
- /** Set bitdepth to 8, 10 or 12 bit (optional, default 8) */
4927
- bitdepth?: 8 | 10 | 12 | undefined;
4928
- /** Tune output for a quality metric, one of 'auto', 'iq', 'psnr' or 'ssim' (optional, default 'auto') */
4929
- tune?: HeifTune | undefined;
4930
- }
4931
-
4932
- interface GifOptions extends OutputOptions, AnimationOptions {
4933
- /** Re-use existing palette, otherwise generate new (slow) */
4934
- reuse?: boolean | undefined;
4935
- /** Use progressive (interlace) scan */
4936
- progressive?: boolean | undefined;
4937
- /** Maximum number of palette entries, including transparency, between 2 and 256 (optional, default 256) */
4938
- colours?: number | undefined;
4939
- /** Alternative spelling of "colours". Maximum number of palette entries, including transparency, between 2 and 256 (optional, default 256) */
4940
- colors?: number | undefined;
4941
- /** Level of CPU effort to reduce file size, between 1 (fastest) and 10 (slowest) (optional, default 7) */
4942
- effort?: number | undefined;
4943
- /** Level of Floyd-Steinberg error diffusion, between 0 (least) and 1 (most) (optional, default 1.0) */
4944
- dither?: number | undefined;
4945
- /** Maximum inter-frame error for transparency, between 0 (lossless) and 32 (optional, default 0) */
4946
- interFrameMaxError?: number | undefined;
4947
- /** Maximum inter-palette error for palette reuse, between 0 and 256 (optional, default 3) */
4948
- interPaletteMaxError?: number | undefined;
4949
- /** Keep duplicate frames in the output instead of combining them (optional, default false) */
4950
- keepDuplicateFrames?: boolean | undefined;
4951
- }
4952
-
4953
- interface TiffOptions extends OutputOptions {
4954
- /** Quality, integer 1-100 (optional, default 80) */
4955
- quality?: number | undefined;
4956
- /** Compression options: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k (optional, default 'jpeg') */
4957
- compression?: string | undefined;
4958
- /** Use BigTIFF variant (has no effect when compression is none) (optional, default false) */
4959
- bigtiff?: boolean | undefined;
4960
- /** Compression predictor options: none, horizontal, float (optional, default 'horizontal') */
4961
- predictor?: string | undefined;
4962
- /** Write an image pyramid (optional, default false) */
4963
- pyramid?: boolean | undefined;
4964
- /** Write a tiled tiff (optional, default false) */
4965
- tile?: boolean | undefined;
4966
- /** Horizontal tile size (optional, default 256) */
4967
- tileWidth?: number | undefined;
4968
- /** Vertical tile size (optional, default 256) */
4969
- tileHeight?: number | undefined;
4970
- /** Horizontal resolution in pixels/mm (optional, default 1.0) */
4971
- xres?: number | undefined;
4972
- /** Vertical resolution in pixels/mm (optional, default 1.0) */
4973
- yres?: number | undefined;
4974
- /** Reduce bitdepth to 1, 2 or 4 bit (optional) */
4975
- bitdepth?: 1 | 2 | 4 | undefined;
4976
- /** Write 1-bit images as miniswhite (optional, default false) */
4977
- miniswhite?: boolean | undefined;
4978
- /** Resolution unit options: inch, cm (optional, default 'inch') */
4979
- resolutionUnit?: Unit | undefined;
4980
- }
4981
-
4982
- interface PngOptions extends OutputOptions {
4983
- /** Use progressive (interlace) scan (optional, default false) */
4984
- progressive?: boolean | undefined;
4985
- /** zlib compression level, 0-9 (optional, default 6) */
4986
- compressionLevel?: number | undefined;
4987
- /** Use adaptive row filtering (optional, default false) */
4988
- adaptiveFiltering?: boolean | undefined;
4989
- /** Use the lowest number of colours needed to achieve given quality (optional, default `100`) */
4990
- quality?: number | undefined;
4991
- /** Level of CPU effort to reduce file size, between 1 (fastest) and 10 (slowest), sets palette to true (optional, default 7) */
4992
- effort?: number | undefined;
4993
- /** Quantise to a palette-based image with alpha transparency support (optional, default false) */
4994
- palette?: boolean | undefined;
4995
- /** Maximum number of palette entries (optional, default 256) */
4996
- colours?: number | undefined;
4997
- /** Alternative Spelling of "colours". Maximum number of palette entries (optional, default 256) */
4998
- colors?: number | undefined;
4999
- /** Level of Floyd-Steinberg error diffusion (optional, default 1.0) */
5000
- dither?: number | undefined;
5001
- }
5002
-
5003
- interface RotateOptions {
5004
- /** parsed by the color module to extract values for red, green, blue and alpha. (optional, default "#000000") */
5005
- background?: ColorLike | undefined;
5006
- }
5007
-
5008
- type Precision = 'integer' | 'float' | 'approximate';
5009
-
5010
- interface BlurOptions {
5011
- /** A value between 0.3 and 1000 representing the sigma of the Gaussian mask, where `sigma = 1 + radius / 2` */
5012
- sigma: number;
5013
- /** A value between 0.001 and 1. A smaller value will generate a larger, more accurate mask. */
5014
- minAmplitude?: number;
5015
- /** How accurate the operation should be, one of: integer, float, approximate. (optional, default "integer") */
5016
- precision?: Precision | undefined;
5017
- }
5018
-
5019
- interface FlattenOptions {
5020
- /** background colour, parsed by the color module, defaults to black. (optional, default {r:0,g:0,b:0}) */
5021
- background?: ColorLike | undefined;
5022
- }
5023
-
5024
- interface NegateOptions {
5025
- /** whether or not to negate any alpha channel. (optional, default true) */
5026
- alpha?: boolean | undefined;
5027
- }
5028
-
5029
- interface NormaliseOptions {
5030
- /** Percentile below which luminance values will be underexposed. */
5031
- lower?: number | undefined;
5032
- /** Percentile above which luminance values will be overexposed. */
5033
- upper?: number | undefined;
5034
- }
5035
-
5036
- interface ResizeOptions {
5037
- /** Alternative means of specifying width. If both are present this takes priority. */
5038
- width?: number | undefined;
5039
- /** Alternative means of specifying height. If both are present this takes priority. */
5040
- height?: number | undefined;
5041
- /** How the image should be resized to fit both provided dimensions, one of cover, contain, fill, inside or outside. (optional, default 'cover') */
5042
- fit?: keyof FitEnum | undefined;
5043
- /** Position, gravity or strategy to use when fit is cover or contain. (optional, default 'centre') */
5044
- position?: number | string | undefined;
5045
- /** Background colour when using a fit of contain, parsed by the color module, defaults to black without transparency. (optional, default {r:0,g:0,b:0,alpha:1}) */
5046
- background?: ColorLike | undefined;
5047
- /** The kernel to use for image reduction. (optional, default 'lanczos3') */
5048
- kernel?: keyof KernelEnum | undefined;
5049
- /** Do not enlarge if the width or height are already less than the specified dimensions, equivalent to GraphicsMagick's > geometry option. (optional, default false) */
5050
- withoutEnlargement?: boolean | undefined;
5051
- /** Do not reduce if the width or height are already greater than the specified dimensions, equivalent to GraphicsMagick's < geometry option. (optional, default false) */
5052
- withoutReduction?: boolean | undefined;
5053
- /** Take greater advantage of the JPEG and WebP shrink-on-load feature, which can lead to a slight moiré pattern on some images. (optional, default true) */
5054
- fastShrinkOnLoad?: boolean | undefined;
5055
- }
5056
-
5057
- interface Region {
5058
- /** zero-indexed offset from left edge */
5059
- left: number;
5060
- /** zero-indexed offset from top edge */
5061
- top: number;
5062
- /** dimension of extracted image */
5063
- width: number;
5064
- /** dimension of extracted image */
5065
- height: number;
5066
- }
5067
-
5068
- interface Noise {
5069
- /** type of generated noise, currently only gaussian is supported. */
5070
- type: 'gaussian';
5071
- /** mean of pixels in generated noise. */
5072
- mean?: number | undefined;
5073
- /** standard deviation of pixels in generated noise. */
5074
- sigma?: number | undefined;
5075
- }
5076
-
5077
- type ExtendWith = 'background' | 'copy' | 'repeat' | 'mirror';
5078
-
5079
- interface ExtendOptions {
5080
- /** single pixel count to top edge (optional, default 0) */
5081
- top?: number | undefined;
5082
- /** single pixel count to left edge (optional, default 0) */
5083
- left?: number | undefined;
5084
- /** single pixel count to bottom edge (optional, default 0) */
5085
- bottom?: number | undefined;
5086
- /** single pixel count to right edge (optional, default 0) */
5087
- right?: number | undefined;
5088
- /** background colour, parsed by the color module, defaults to black without transparency. (optional, default {r:0,g:0,b:0,alpha:1}) */
5089
- background?: ColorLike | undefined;
5090
- /** how the extension is done, one of: "background", "copy", "repeat", "mirror" (optional, default `'background'`) */
5091
- extendWith?: ExtendWith | undefined;
5092
- }
5093
-
5094
- interface TrimOptions {
5095
- /** Background colour, parsed by the color module, defaults to that of the top-left pixel. (optional) */
5096
- background?: ColorLike | undefined;
5097
- /** Allowed difference from the above colour, a positive number. (optional, default 10) */
5098
- threshold?: number | undefined;
5099
- /** Does the input more closely resemble line art (e.g. vector) rather than being photographic? (optional, default false) */
5100
- lineArt?: boolean | undefined;
5101
- /** Leave a margin around trimmed content, value is in pixels. (optional, default 0) */
5102
- margin?: number | undefined;
5103
- }
5104
-
5105
- interface RawOptions {
5106
- depth?: keyof DepthEnum;
5107
- }
5108
-
5109
- /** 1 for grayscale, 2 for grayscale + alpha, 3 for sRGB, 4 for CMYK or RGBA */
5110
- type Channels = 1 | 2 | 3 | 4;
5111
-
5112
- type Colour = ColorLike;
5113
- type Color = ColorLike;
5114
-
5115
- interface Kernel {
5116
- /** width of the kernel in pixels. */
5117
- width: number;
5118
- /** height of the kernel in pixels. */
5119
- height: number;
5120
- /** Array of length width*height containing the kernel values. */
5121
- kernel: ArrayLike<number>;
5122
- /** the scale of the kernel in pixels. (optional, default sum) */
5123
- scale?: number | undefined;
5124
- /** the offset of the kernel in pixels. (optional, default 0) */
5125
- offset?: number | undefined;
5126
- }
5127
-
5128
- interface ClaheOptions {
5129
- /** width of the region */
5130
- width: number;
5131
- /** height of the region */
5132
- height: number;
5133
- /** max slope of the cumulative contrast. A value of 0 disables contrast limiting. Valid values are integers in the range 0-100 (inclusive) (optional, default 3) */
5134
- maxSlope?: number | undefined;
5135
- }
5136
-
5137
- interface ThresholdOptions {
5138
- /** convert to single channel greyscale. (optional, default true) */
5139
- greyscale?: boolean | undefined;
5140
- /** alternative spelling for greyscale. (optional, default true) */
5141
- grayscale?: boolean | undefined;
5142
- }
5143
-
5144
- interface OverlayOptions extends SharpOptions {
5145
- /** Buffer containing image data, String containing the path to an image file, or Create object */
5146
- input?: string | Buffer | { create: Create } | { text: CreateText } | { raw: CreateRaw } | undefined;
5147
- /** how to blend this image with the image below. (optional, default `'over'`) */
5148
- blend?: Blend | undefined;
5149
- /** gravity at which to place the overlay. (optional, default 'centre') */
5150
- gravity?: Gravity | undefined;
5151
- /** the pixel offset from the top edge. */
5152
- top?: number | undefined;
5153
- /** the pixel offset from the left edge. */
5154
- left?: number | undefined;
5155
- /** set to true to repeat the overlay image across the entire image with the given gravity. (optional, default false) */
5156
- tile?: boolean | undefined;
5157
- /** Set to true to avoid premultipling the image below. Equivalent to the --premultiplied vips option. */
5158
- premultiplied?: boolean | undefined;
5159
- /** number representing the DPI for vector overlay image. (optional, default 72)*/
5160
- density?: number | undefined;
5161
- /** Set to true to read all frames/pages of an animated image. (optional, default false) */
5162
- animated?: boolean | undefined;
5163
- /** see sharp() constructor, (optional, default 'warning') */
5164
- failOn?: FailOnOptions | undefined;
5165
- /** see sharp() constructor, (optional, default 268402689) */
5166
- limitInputPixels?: number | boolean | undefined;
5167
- /** see sharp() constructor, (optional, default false) */
5168
- autoOrient?: boolean | undefined;
5169
- }
5170
-
5171
- interface TileOptions {
5172
- /** Tile size in pixels, a value between 1 and 8192. (optional, default 256) */
5173
- size?: number | undefined;
5174
- /** Tile overlap in pixels, a value between 0 and 8192. (optional, default 0) */
5175
- overlap?: number | undefined;
5176
- /** Tile angle of rotation, must be a multiple of 90. (optional, default 0) */
5177
- angle?: number | undefined;
5178
- /** background colour, parsed by the color module, defaults to white without transparency. (optional, default {r:255,g:255,b:255,alpha:1}) */
5179
- background?: ColorLike | undefined;
5180
- /** How deep to make the pyramid, possible values are "onepixel", "onetile" or "one" (default based on layout) */
5181
- depth?: string | undefined;
5182
- /** Threshold to skip tile generation, a value 0 - 255 for 8-bit images or 0 - 65535 for 16-bit images */
5183
- skipBlanks?: number | undefined;
5184
- /** Tile container, with value fs (filesystem) or zip (compressed file). (optional, default 'fs') */
5185
- container?: TileContainer | undefined;
5186
- /** Filesystem layout, possible values are dz, iiif, iiif3, zoomify or google. (optional, default 'dz') */
5187
- layout?: TileLayout | undefined;
5188
- /** Centre image in tile. (optional, default false) */
5189
- centre?: boolean | undefined;
5190
- /** Alternative spelling of centre. (optional, default false) */
5191
- center?: boolean | undefined;
5192
- /** When layout is iiif/iiif3, sets the @id/id attribute of info.json (optional, default 'https://example.com/iiif') */
5193
- id?: string | undefined;
5194
- /** The name of the directory within the zip file when container is `zip`. */
5195
- basename?: string | undefined;
5196
- }
5197
-
5198
- interface AnimationOptions {
5199
- /** Number of animation iterations, a value between 0 and 65535. Use 0 for infinite animation. (optional, default 0) */
5200
- loop?: number | undefined;
5201
- /** delay(s) between animation frames (in milliseconds), each value between 0 and 65535. (optional) */
5202
- delay?: number | number[] | undefined;
5203
- }
5204
-
5205
- interface SharpenOptions {
5206
- /** The sigma of the Gaussian mask, where sigma = 1 + radius / 2, between 0.000001 and 10000 */
5207
- sigma: number;
5208
- /** The level of sharpening to apply to "flat" areas, between 0 and 1000000 (optional, default 1.0) */
5209
- m1?: number | undefined;
5210
- /** The level of sharpening to apply to "jagged" areas, between 0 and 1000000 (optional, default 2.0) */
5211
- m2?: number | undefined;
5212
- /** Threshold between "flat" and "jagged", between 0 and 1000000 (optional, default 2.0) */
5213
- x1?: number | undefined;
5214
- /** Maximum amount of brightening, between 0 and 1000000 (optional, default 10.0) */
5215
- y2?: number | undefined;
5216
- /** Maximum amount of darkening, between 0 and 1000000 (optional, default 20.0) */
5217
- y3?: number | undefined;
5218
- }
5219
-
5220
- interface AffineOptions {
5221
- /** Parsed by the color module to extract values for red, green, blue and alpha. (optional, default "#000000") */
5222
- background?: string | object | undefined;
5223
- /** Input horizontal offset (optional, default 0) */
5224
- idx?: number | undefined;
5225
- /** Input vertical offset (optional, default 0) */
5226
- idy?: number | undefined;
5227
- /** Output horizontal offset (optional, default 0) */
5228
- odx?: number | undefined;
5229
- /** Output horizontal offset (optional, default 0) */
5230
- ody?: number | undefined;
5231
- /** Interpolator (optional, default sharp.interpolators.bicubic) */
5232
- interpolator?: Interpolators[keyof Interpolators] | undefined;
5233
- }
5234
-
5235
- interface OutputInfo {
5236
- format: string;
5237
- size: number;
5238
- width: number;
5239
- height: number;
5240
- channels: Channels;
5241
- /** indicating if premultiplication was used */
5242
- premultiplied: boolean;
5243
- /** Only defined when using a crop strategy */
5244
- cropOffsetLeft?: number | undefined;
5245
- /** Only defined when using a crop strategy */
5246
- cropOffsetTop?: number | undefined;
5247
- /** Only defined when using a trim method */
5248
- trimOffsetLeft?: number | undefined;
5249
- /** Only defined when using a trim method */
5250
- trimOffsetTop?: number | undefined;
5251
- /** DPI the font was rendered at, only defined when using `text` input */
5252
- textAutofitDpi?: number | undefined;
5253
- /** When using the attention crop strategy, the focal point of the cropped region */
5254
- attentionX?: number | undefined;
5255
- attentionY?: number | undefined;
5256
- /** Number of pages/frames contained within the image, with support for TIFF, HEIF, PDF, animated GIF and animated WebP */
5257
- pages?: number | undefined;
5258
- /** Number of pixels high each page in a multi-page image will be. */
5259
- pageHeight?: number | undefined;
5260
- }
5261
-
5262
- interface AvailableFormatInfo {
5263
- id: string;
5264
- input: { file: boolean; buffer: boolean; stream: boolean; fileSuffix?: string[] };
5265
- output: { file: boolean; buffer: boolean; stream: boolean; alias?: string[] };
5266
- }
5267
-
5268
- interface FitEnum {
5269
- contain: 'contain';
5270
- cover: 'cover';
5271
- fill: 'fill';
5272
- inside: 'inside';
5273
- outside: 'outside';
5274
- }
5275
-
5276
- interface KernelEnum {
5277
- nearest: 'nearest';
5278
- cubic: 'cubic';
5279
- linear: 'linear';
5280
- mitchell: 'mitchell';
5281
- lanczos2: 'lanczos2';
5282
- lanczos3: 'lanczos3';
5283
- mks2013: 'mks2013';
5284
- mks2021: 'mks2021';
5285
- }
5286
-
5287
- interface PresetEnum {
5288
- default: 'default';
5289
- picture: 'picture';
5290
- photo: 'photo';
5291
- drawing: 'drawing';
5292
- icon: 'icon';
5293
- text: 'text';
5294
- }
5295
-
5296
- interface BoolEnum {
5297
- and: 'and';
5298
- or: 'or';
5299
- eor: 'eor';
5300
- }
5301
-
5302
- interface ColourspaceEnum {
5303
- 'b-w': string;
5304
- cmc: string;
5305
- cmyk: string;
5306
- fourier: string;
5307
- grey16: string;
5308
- histogram: string;
5309
- hsv: string;
5310
- lab: string;
5311
- labq: string;
5312
- labs: string;
5313
- lch: string;
5314
- matrix: string;
5315
- multiband: string;
5316
- rgb: string;
5317
- rgb16: string;
5318
- scrgb: string;
5319
- srgb: string;
5320
- xyz: string;
5321
- yxy: string;
5322
- }
5323
-
5324
- interface DepthEnum {
5325
- char: string;
5326
- complex: string;
5327
- double: string;
5328
- dpcomplex: string;
5329
- float: string;
5330
- int: string;
5331
- short: string;
5332
- uchar: string;
5333
- uint: string;
5334
- ushort: string;
5335
- }
5336
-
5337
- type FailOnOptions = 'none' | 'truncated' | 'error' | 'warning';
5338
-
5339
- type TextAlign = 'left' | 'centre' | 'center' | 'right';
5340
-
5341
- type TextWrap = 'word' | 'char' | 'word-char' | 'none';
5342
-
5343
- type HorizontalAlignment = 'left' | 'centre' | 'center' | 'right';
5344
-
5345
- type VerticalAlignment = 'top' | 'centre' | 'center' | 'bottom';
5346
-
5347
- type TileContainer = 'fs' | 'zip';
5348
-
5349
- type TileLayout = 'dz' | 'iiif' | 'iiif3' | 'zoomify' | 'google';
5350
-
5351
- type Blend =
5352
- | 'clear'
5353
- | 'source'
5354
- | 'over'
5355
- | 'in'
5356
- | 'out'
5357
- | 'atop'
5358
- | 'dest'
5359
- | 'dest-over'
5360
- | 'dest-in'
5361
- | 'dest-out'
5362
- | 'dest-atop'
5363
- | 'xor'
5364
- | 'add'
5365
- | 'saturate'
5366
- | 'multiply'
5367
- | 'screen'
5368
- | 'overlay'
5369
- | 'darken'
5370
- | 'lighten'
5371
- | 'color-dodge'
5372
- | 'colour-dodge'
5373
- | 'color-burn'
5374
- | 'colour-burn'
5375
- | 'hard-light'
5376
- | 'soft-light'
5377
- | 'difference'
5378
- | 'exclusion';
5379
-
5380
- type Gravity = number | string;
5381
-
5382
- interface GravityEnum {
5383
- north: number;
5384
- northeast: number;
5385
- southeast: number;
5386
- south: number;
5387
- southwest: number;
5388
- west: number;
5389
- northwest: number;
5390
- east: number;
5391
- center: number;
5392
- centre: number;
5393
- }
5394
-
5395
- interface StrategyEnum {
5396
- entropy: number;
5397
- attention: number;
5398
- }
5399
-
5400
- interface FormatEnum {
5401
- dcraw: AvailableFormatInfo;
5402
- dz: AvailableFormatInfo;
5403
- exr: AvailableFormatInfo;
5404
- fits: AvailableFormatInfo;
5405
- gif: AvailableFormatInfo;
5406
- heif: AvailableFormatInfo;
5407
- jpeg: AvailableFormatInfo;
5408
- jp2: AvailableFormatInfo;
5409
- jxl: AvailableFormatInfo;
5410
- magick: AvailableFormatInfo;
5411
- openslide: AvailableFormatInfo;
5412
- pdf: AvailableFormatInfo;
5413
- png: AvailableFormatInfo;
5414
- ppm: AvailableFormatInfo;
5415
- rad: AvailableFormatInfo;
5416
- raw: AvailableFormatInfo;
5417
- svg: AvailableFormatInfo;
5418
- tiff: AvailableFormatInfo;
5419
- vips: AvailableFormatInfo;
5420
- webp: AvailableFormatInfo;
5421
- }
5422
-
5423
- interface CacheResult {
5424
- memory: { current: number; high: number; max: number };
5425
- files: { current: number; max: number };
5426
- items: { current: number; max: number };
5427
- }
5428
-
5429
- interface Interpolators {
5430
- /** [Nearest neighbour interpolation](http://en.wikipedia.org/wiki/Nearest-neighbor_interpolation). Suitable for image enlargement only. */
5431
- nearest: 'nearest';
5432
- /** [Bilinear interpolation](http://en.wikipedia.org/wiki/Bilinear_interpolation). Faster than bicubic but with less smooth results. */
5433
- bilinear: 'bilinear';
5434
- /** [Bicubic interpolation](http://en.wikipedia.org/wiki/Bicubic_interpolation) (the default). */
5435
- bicubic: 'bicubic';
5436
- /**
5437
- * [LBB interpolation](https://github.com/libvips/libvips/blob/master/libvips/resample/lbb.cpp#L100).
5438
- * Prevents some "[acutance](http://en.wikipedia.org/wiki/Acutance)" but typically reduces performance by a factor of 2.
5439
- */
5440
- locallyBoundedBicubic: 'lbb';
5441
- /** [Nohalo interpolation](http://eprints.soton.ac.uk/268086/). Prevents acutance but typically reduces performance by a factor of 3. */
5442
- nohalo: 'nohalo';
5443
- /** [VSQBS interpolation](https://github.com/libvips/libvips/blob/master/libvips/resample/vsqbs.cpp#L48). Prevents "staircasing" when enlarging. */
5444
- vertexSplitQuadraticBasisSpline: 'vsqbs';
5445
- }
5446
-
5447
- type Matrix2x2 = [[number, number], [number, number]];
5448
- type Matrix3x3 = [[number, number, number], [number, number, number], [number, number, number]];
5449
- type Matrix4x4 = [[number, number, number, number], [number, number, number, number], [number, number, number, number], [number, number, number, number]];
3398
+ * Subscription management interface for sessions.
3399
+ */
3400
+ interface Subscribed {
3401
+ /** Add subscriptions to be cleaned up on unsubscribe */
3402
+ addSubscriptions(...subscriptions: Disposable[]): void;
3403
+ /** Add additional subscriptions (separate cleanup) */
3404
+ addAdditionalSubscriptions(...subscriptions: Disposable[]): void;
3405
+ /** Unsubscribe all main subscriptions */
3406
+ unsubscribe(): void;
3407
+ /** Unsubscribe additional subscriptions only */
3408
+ unsubscribeAdditional(): void;
5450
3409
  }
5451
3410
 
5452
3411
  type Extension = {
@@ -5493,176 +3452,6 @@ declare class RtpPacket {
5493
3452
  clear(): void;
5494
3453
  }
5495
3454
 
5496
- /**
5497
- * Decoded frame metadata from the video decoder.
5498
- */
5499
- interface FrameMetadata {
5500
- /** Decoder format */
5501
- format: DecoderFormat;
5502
- /** Total frame data size in bytes */
5503
- frameSize: number;
5504
- /** Current frame width (may be scaled) */
5505
- width: number;
5506
- /** Current frame height (may be scaled) */
5507
- height: number;
5508
- /** Original video width before scaling */
5509
- origWidth: number;
5510
- /** Original video height before scaling */
5511
- origHeight: number;
5512
- }
5513
- /**
5514
- * Image dimension and format information.
5515
- */
5516
- interface ImageInformation {
5517
- /** Image width in pixels */
5518
- width: number;
5519
- /** Image height in pixels */
5520
- height: number;
5521
- /** Number of color channels (1=gray, 3=RGB, 4=RGBA) */
5522
- channels: number;
5523
- /** Pixel format */
5524
- format: ImageInputFormat;
5525
- }
5526
- /**
5527
- * Crop region for image processing.
5528
- */
5529
- interface ImageCrop {
5530
- /** Top offset in pixels */
5531
- top: number;
5532
- /** Left offset in pixels */
5533
- left: number;
5534
- /** Crop width in pixels */
5535
- width: number;
5536
- /** Crop height in pixels */
5537
- height: number;
5538
- }
5539
- /**
5540
- * Resize dimensions for image processing.
5541
- */
5542
- interface ImageResize {
5543
- /** Target width in pixels */
5544
- width: number;
5545
- /** Target height in pixels */
5546
- height: number;
5547
- }
5548
- /**
5549
- * Output format conversion option.
5550
- */
5551
- interface ImageFormat {
5552
- /** Target pixel format */
5553
- to: ImageOutputFormat;
5554
- }
5555
- /**
5556
- * Combined image processing options.
5557
- */
5558
- interface ImageOptions {
5559
- /** Output format conversion */
5560
- format?: ImageFormat;
5561
- /** Crop region */
5562
- crop?: ImageCrop;
5563
- /** Resize dimensions */
5564
- resize?: ImageResize;
5565
- }
5566
- /**
5567
- * Processed image with sharp instance.
5568
- */
5569
- interface FrameImage {
5570
- /** Sharp image instance for further processing */
5571
- image: sharp.Sharp;
5572
- /** Image information */
5573
- info: ImageInformation;
5574
- }
5575
- /**
5576
- * Processed image as raw buffer.
5577
- */
5578
- interface FrameBuffer {
5579
- /** Raw pixel data */
5580
- image: Uint8Array;
5581
- /** Image information */
5582
- info: ImageInformation;
5583
- }
5584
- /**
5585
- * Raw frame data from decoder.
5586
- */
5587
- interface FrameData {
5588
- /** Unique frame identifier */
5589
- id: string;
5590
- /** Raw frame pixel data */
5591
- data: Uint8Array;
5592
- /** Frame capture timestamp */
5593
- timestamp: number;
5594
- /** Decoder metadata */
5595
- metadata: FrameMetadata;
5596
- /** Image information */
5597
- info: ImageInformation;
5598
- }
5599
- /**
5600
- * Video frame with processing capabilities.
5601
- * Provides methods to convert raw decoder output to usable image formats.
5602
- */
5603
- interface VideoFrame {
5604
- /** Unique frame identifier */
5605
- readonly id: string;
5606
- /** Raw frame pixel data */
5607
- readonly data: Uint8Array;
5608
- /** Decoder metadata */
5609
- readonly metadata: FrameMetadata;
5610
- /** Image information */
5611
- readonly info: ImageInformation;
5612
- /** Frame capture timestamp */
5613
- readonly timestamp: number;
5614
- /** Original video width */
5615
- readonly inputWidth: number;
5616
- /** Original video height */
5617
- readonly inputHeight: number;
5618
- /** Decoder output format */
5619
- readonly inputFormat: DecoderFormat;
5620
- /**
5621
- * Convert frame to raw pixel buffer.
5622
- *
5623
- * @returns Processed image buffer with metadata
5624
- */
5625
- toBuffer(): Promise<FrameBuffer>;
5626
- /**
5627
- * Convert frame to sharp image instance.
5628
- *
5629
- * @returns Sharp image for further processing
5630
- */
5631
- toImage(): Promise<FrameImage>;
5632
- }
5633
- /**
5634
- * Frame worker (decoder) settings.
5635
- */
5636
- interface CameraFrameWorkerSettings {
5637
- /** Target frames per second for detection */
5638
- fps: number;
5639
- }
5640
- /**
5641
- * Snapshot settings for a camera.
5642
- */
5643
- interface SnapshotSettings {
5644
- /** Enable automatic snapshot refresh */
5645
- autoRefresh: boolean;
5646
- /** Cache TTL in seconds (how long a snapshot is valid) */
5647
- ttl: number;
5648
- /** Auto-refresh interval in seconds (min: 10, max: 60) */
5649
- interval: number;
5650
- }
5651
-
5652
- /**
5653
- * Subscription management interface for sessions.
5654
- */
5655
- interface Subscribed {
5656
- /** Add subscriptions to be cleaned up on unsubscribe */
5657
- addSubscriptions(...subscriptions: Disposable[]): void;
5658
- /** Add additional subscriptions (separate cleanup) */
5659
- addAdditionalSubscriptions(...subscriptions: Disposable[]): void;
5660
- /** Unsubscribe all main subscriptions */
5661
- unsubscribe(): void;
5662
- /** Unsubscribe additional subscriptions only */
5663
- unsubscribeAdditional(): void;
5664
- }
5665
-
5666
3455
  /**
5667
3456
  * WebSocket streaming URLs from go2rtc.
5668
3457
  */
@@ -6773,8 +4562,9 @@ interface PluginContract {
6773
4562
  */
6774
4563
  pythonVersion?: PythonVersion;
6775
4564
  /**
6776
- * Extra package dependencies installed into the plugin's runtime (PyPI
6777
- * for Python plugins, npm for Node plugins).
4565
+ * Extra package dependencies installed into the plugin's runtime (Go
4566
+ * module paths for Go plugins; PyPI / npm names for Python and Node
4567
+ * plugins).
6778
4568
  */
6779
4569
  dependencies?: string[];
6780
4570
  }
@@ -6915,7 +4705,7 @@ interface ClassifierResult {
6915
4705
  */
6916
4706
  declare abstract class ClassifierDetectorSensor<TStorage extends object = Record<string, any>> extends ClassifierSensor<TStorage> {
6917
4707
  _requiresFrames: boolean;
6918
- /** Declares the expected input dimensions and trigger labels. */
4708
+ /** Declares the expected input dimensions and trigger labels. The backend scales frames to match. */
6919
4709
  abstract get modelSpec(): ModelSpec;
6920
4710
  /**
6921
4711
  * Classify frames in batch. Each frame is a pre-cropped, pre-scaled
@@ -7000,6 +4790,18 @@ declare enum API_EVENT {
7000
4790
  * The PluginAPI is injected into the plugin at runtime and exposes the
7001
4791
  * system services the plugin is allowed to talk to. It also acts as an
7002
4792
  * EventEmitter for plugin lifecycle events (see {@link API_EVENT}).
4793
+ *
4794
+ * @example
4795
+ * ```ts
4796
+ * import { BasePlugin } from '@camera.ui/sdk';
4797
+ *
4798
+ * export default class MyPlugin extends BasePlugin {
4799
+ * async configureCameras() {
4800
+ * // Access FFmpeg path
4801
+ * const ffmpeg = await this.api.coreManager.getFFmpegPath();
4802
+ * }
4803
+ * }
4804
+ * ```
7003
4805
  */
7004
4806
  interface PluginAPI {
7005
4807
  /**
@@ -7220,7 +5022,11 @@ interface ClipDetectionPluginResponse {
7220
5022
  embeddings: ClipEmbedding[];
7221
5023
  embeddingModel: string;
7222
5024
  }
7223
- /** Result of a CLIP text embedding request */
5025
+ /**
5026
+ * Result of a CLIP text embedding request — a single embedding vector plus
5027
+ * the model name used to produce it, so downstream code can refuse to mix
5028
+ * embeddings from different models.
5029
+ */
7224
5030
  interface ClipTextEmbeddingResult {
7225
5031
  embedding: number[];
7226
5032
  embeddingModel: string;
@@ -7256,8 +5062,6 @@ interface ClipTextEmbeddingResult {
7256
5062
  * }
7257
5063
  * }
7258
5064
  * ```
7259
- *
7260
- * @see /examples/getting-started — end-to-end walkthrough.
7261
5065
  */
7262
5066
  declare abstract class BasePlugin<T extends Record<string, any> = Record<string, any>> {
7263
5067
  logger: LoggerService;
@@ -7371,6 +5175,8 @@ interface AudioDetectionInterface {
7371
5175
  /**
7372
5176
  * Interface for plugins that provide face detection.
7373
5177
  * Implement `testFaceDetection()` to handle detection test requests from the UI.
5178
+ * The NVR owns matching against enrolled faces; the plugin only emits raw
5179
+ * detections + embeddings.
7374
5180
  */
7375
5181
  interface FaceDetectionInterface {
7376
5182
  /** Run face detection on image data. Used by the UI for testing/previewing. */
@@ -7922,5 +5728,5 @@ interface OAuthClientCredentialsCapable extends OAuthCapable {
7922
5728
  configureClientCredentials(clientId: string, clientSecret: string): Promise<OAuthState>;
7923
5729
  }
7924
5730
 
7925
- export { API_EVENT, AudioDetectorSensor, AudioProperty, AudioSensor, BASE_AUDIO_LABELS, BasePlugin, BatteryCapability, BatteryInfo, BatteryProperty, BehaviorSubject, ChargingState, ClassifierDetectorSensor, ClassifierProperty, ClassifierSensor, ClipDetectorSensor, ContactProperty, ContactSensor, DETECTION_ATTRIBUTES, DETECTION_LABELS, Disposable, DoorbellProperty, DoorbellTrigger, EVENT_TRIGGER_TYPES, FaceDetectorSensor, FaceProperty, FaceSensor, GarageControl, GarageProperty, GarageState, HumidityInfo, HumidityProperty, LeakProperty, LeakSensor, LicensePlateDetectorSensor, LicensePlateProperty, LicensePlateSensor, LightCapability, LightControl, LightProperty, LockControl, LockProperty, LockState, MotionDetectorSensor, MotionProperty, MotionSensor, ObjectDetectorSensor, ObjectProperty, ObjectSensor, Observable, OccupancyProperty, OccupancySensor, PTZCapability, PTZControl, PTZProperty, PluginCapability, PluginInterface, PluginRole, RING_AUTO_RESET_MS, ReplaySubject, RtpPacket, SecuritySystem, SecuritySystemProperty, SecuritySystemState, Sensor, SensorCategory, SensorType, Severity, SirenCapability, SirenControl, SirenProperty, SmokeProperty, SmokeSensor, Subject, SwitchControl, SwitchProperty, TemperatureInfo, TemperatureProperty, canCreateCameras, canProvideSensorsToAnyCameras, distinctUntilChanged, filter, firstValueFrom, getContractValidationErrors, hasCapability, hasInterface, isHub, map, mergeMap, pairwise, share, sharp, validateContractConsistency };
7926
- export type { AssignedPlugin, AudioCodec, AudioCodecProperties, AudioDetectionInterface, AudioDetectionPluginResponse, AudioDetectionSettings, AudioFFmpegCodec, AudioFrameData, AudioInputSpec, AudioLabel, AudioMetadata, AudioModelSpec, AudioResult, AudioSensorLike, AudioSensorProperties, AudioStreamInfo, BaseAudioLabel, BaseCamera, BaseCameraConfig, BatteryInfoLike, BatteryInfoProperties, BoundingBox, Camera, CameraAspectRatio, CameraConfig, CameraConfigInputSettings, CameraDetectionSettings, CameraDevice, CameraDeviceSource, CameraFrameWorkerSettings, CameraImplementation, CameraInformation, CameraInput, CameraPluginInfo, CameraRole, CameraSource, CameraType, CameraUiSettings, ClassifierDetection, ClassifierDetectionInterface, ClassifierDetectionPluginResponse, ClassifierResult, ClassifierSensorLike, ClassifierSensorProperties, ClipDetectionInterface, ClipDetectionPluginResponse, ClipEmbedding, ClipResult, ClipTextEmbeddingResult, ContactSensorLike, ContactSensorProperties, CoreManager, CoreManagerEvent, CreateDownloadOptions, CreateStreamDownloadOptions, DecoderFormat, Detection, DetectionAttribute, DetectionEvent, DetectionEventState, DetectionEventType, DetectionLabel, DetectionLine, DetectionZone, DeviceManager, DeviceStorage, DiscoveredCamera, DiscoveryProvider, DoorbellTriggerLike, DoorbellTriggerProperties, DownloadCleanup, DownloadManager, DownloadToken, EventAttribute, EventDescription, EventDetection, EventSegment, EventTrigger, EventTriggerType, FMTPInfo, FaceDetection, FaceDetectionInterface, FaceDetectionPluginResponse, FaceResult, FaceSensorLike, FaceSensorProperties, Fmp4Session, Fmp4SessionOptions, FormSubmitResponse, FormSubmitSchema, FrameBuffer, FrameData, FrameImage, FrameMetadata, GarageControlLike, GarageControlProperties, Go2RtcRTSPSource, Go2RtcSnapshotSource, Go2RtcWSSource, HardwareAcceleration, HumidityInfoLike, HumidityInfoProperties, ImageCrop, ImageFormat, ImageInformation, ImageInputFormat, ImageMetadata, ImageOptions, ImageOutputFormat, ImageResize, JsonArraySchema, JsonBaseSchema, JsonBaseSchemaWithoutCallbacks, JsonBooleanSchema, JsonEnumSchema, JsonFactorySchema, JsonNumberSchema, JsonSchema, JsonSchemaArray, JsonSchemaArrayWithoutCallbacks, JsonSchemaBoolean, JsonSchemaBooleanWithoutCallbacks, JsonSchemaButton, JsonSchemaEnum, JsonSchemaEnumWithoutCallbacks, JsonSchemaNumber, JsonSchemaNumberWithoutCallbacks, JsonSchemaString, JsonSchemaStringWithoutCallbacks, JsonSchemaSubmit, JsonSchemaType, JsonSchemaWithoutCallbacks, JsonSchemaWithoutKey, JsonStringSchema, LeakSensorLike, LeakSensorProperties, LicensePlateDetection, LicensePlateDetectionInterface, LicensePlateDetectionPluginResponse, LicensePlateResult, LicensePlateSensorLike, LicensePlateSensorProperties, LightControlLike, LightControlProperties, LineDirection, LockControlLike, LockControlProperties, LoggerService, ModelSpec, MotionDetectionInterface, MotionDetectionPluginResponse, MotionDetectionSettings, MotionResolution, MotionResult, MotionSensorLike, MotionSensorProperties, Notification, NotificationManager, NotifierDevice, NotifierInterface, OAuthAuthCodeFlowCapable, OAuthCapable, OAuthClientCredentialsCapable, OAuthDeviceFlowCapable, OAuthMetadata, OAuthProviderConfig, OAuthProviderDeclaration, OAuthState, OAuthStatus, ObjectDetectionInterface, ObjectDetectionPluginResponse, ObjectDetectionSettings, ObjectModelSpec, ObjectResult, ObjectSensorLike, ObjectSensorProperties, OccupancySensorLike, OccupancySensorProperties, OperatorFn, PTZControlLike, PTZControlProperties, PTZDirection, PTZPosition, PluginAPI, PluginAssignments, PluginConfig, PluginContract, PluginInfo, PluginInterfaces, Point, ProbeAudioCodec, ProbeConfig, ProbeStream, PropertyChangeOf, PtzAutotrackSettings, PythonVersion, RTPInfo, RTSPAudioCodec, RTSPUrlOptions, RtpSession, RtpSessionBackchannelOptions, RtpSessionOptions, SchemaCondition, SchemaConditionOperator, SchemaConfig, SecuritySystemLike, SecuritySystemProperties, SensorCapability, SensorLike, SensorPropertyType, SensorTriggerRef, SensorTriggerSettings, SirenControlLike, SirenControlProperties, SmokeSensorLike, SmokeSensorProperties, SnapshotInterface, SnapshotSettings, SnapshotUrlOptions, StreamDirection, StreamUrls, StreamingInterface, StreamingRole, SwitchControlLike, SwitchControlProperties, TemperatureInfoLike, TemperatureInfoProperties, ToastMessage, TrackedDetection, VideoCodec, VideoCodecProperties, VideoFFmpegCodec, VideoFrame, VideoFrameData, VideoInputSpec, VideoStreamInfo, VideoStreamingMode, ZoneFilter, ZoneType };
5731
+ export { API_EVENT, AudioDetectorSensor, AudioProperty, AudioSensor, BASE_AUDIO_LABELS, BasePlugin, BatteryCapability, BatteryInfo, BatteryProperty, BehaviorSubject, ChargingState, ClassifierDetectorSensor, ClassifierProperty, ClassifierSensor, ClipDetectorSensor, ContactProperty, ContactSensor, DETECTION_ATTRIBUTES, DETECTION_LABELS, Disposable, DoorbellProperty, DoorbellTrigger, EVENT_TRIGGER_TYPES, FaceDetectorSensor, FaceProperty, FaceSensor, GarageControl, GarageProperty, GarageState, HumidityInfo, HumidityProperty, LeakProperty, LeakSensor, LicensePlateDetectorSensor, LicensePlateProperty, LicensePlateSensor, LightCapability, LightControl, LightProperty, LockControl, LockProperty, LockState, MotionDetectorSensor, MotionProperty, MotionSensor, ObjectDetectorSensor, ObjectProperty, ObjectSensor, Observable, OccupancyProperty, OccupancySensor, PTZCapability, PTZControl, PTZProperty, PluginCapability, PluginInterface, PluginRole, RING_AUTO_RESET_MS, ReplaySubject, RtpPacket, SecuritySystem, SecuritySystemProperty, SecuritySystemState, Sensor, SensorCategory, SensorType, Severity, SirenCapability, SirenControl, SirenProperty, SmokeProperty, SmokeSensor, Subject, SwitchControl, SwitchProperty, TemperatureInfo, TemperatureProperty, canCreateCameras, canProvideSensorsToAnyCameras, distinctUntilChanged, filter, firstValueFrom, getContractValidationErrors, hasCapability, hasInterface, isHub, map, mergeMap, pairwise, share, validateContractConsistency };
5732
+ export type { AssignedPlugin, AudioCodec, AudioCodecProperties, AudioDetectionInterface, AudioDetectionPluginResponse, AudioDetectionSettings, AudioFFmpegCodec, AudioFrameData, AudioInputSpec, AudioLabel, AudioMetadata, AudioModelSpec, AudioResult, AudioSensorLike, AudioSensorProperties, AudioStreamInfo, BaseAudioLabel, BaseCamera, BaseCameraConfig, BatteryInfoLike, BatteryInfoProperties, BoundingBox, Camera, CameraAspectRatio, CameraConfig, CameraConfigInputSettings, CameraDetectionSettings, CameraDevice, CameraDeviceSource, CameraFrameWorkerSettings, CameraImplementation, CameraInformation, CameraInput, CameraPluginInfo, CameraRole, CameraSource, CameraType, CameraUiSettings, ClassifierDetection, ClassifierDetectionInterface, ClassifierDetectionPluginResponse, ClassifierResult, ClassifierSensorLike, ClassifierSensorProperties, ClipDetectionInterface, ClipDetectionPluginResponse, ClipEmbedding, ClipResult, ClipTextEmbeddingResult, ContactSensorLike, ContactSensorProperties, CoreManager, CoreManagerEvent, CreateDownloadOptions, CreateStreamDownloadOptions, Detection, DetectionAttribute, DetectionEvent, DetectionEventState, DetectionEventType, DetectionLabel, DetectionLine, DetectionZone, DeviceManager, DeviceStorage, DiscoveredCamera, DiscoveryProvider, DoorbellTriggerLike, DoorbellTriggerProperties, DownloadCleanup, DownloadManager, DownloadToken, EventAttribute, EventDescription, EventDetection, EventSegment, EventTrigger, EventTriggerType, FMTPInfo, FaceDetection, FaceDetectionInterface, FaceDetectionPluginResponse, FaceResult, FaceSensorLike, FaceSensorProperties, Fmp4Session, Fmp4SessionOptions, FormSubmitResponse, FormSubmitSchema, GarageControlLike, GarageControlProperties, Go2RtcRTSPSource, Go2RtcSnapshotSource, Go2RtcWSSource, HardwareAcceleration, HumidityInfoLike, HumidityInfoProperties, ImageMetadata, JsonArraySchema, JsonBaseSchema, JsonBaseSchemaWithoutCallbacks, JsonBooleanSchema, JsonEnumSchema, JsonFactorySchema, JsonNumberSchema, JsonSchema, JsonSchemaArray, JsonSchemaArrayWithoutCallbacks, JsonSchemaBoolean, JsonSchemaBooleanWithoutCallbacks, JsonSchemaButton, JsonSchemaEnum, JsonSchemaEnumWithoutCallbacks, JsonSchemaNumber, JsonSchemaNumberWithoutCallbacks, JsonSchemaString, JsonSchemaStringWithoutCallbacks, JsonSchemaSubmit, JsonSchemaType, JsonSchemaWithoutCallbacks, JsonSchemaWithoutKey, JsonStringSchema, LeakSensorLike, LeakSensorProperties, LicensePlateDetection, LicensePlateDetectionInterface, LicensePlateDetectionPluginResponse, LicensePlateResult, LicensePlateSensorLike, LicensePlateSensorProperties, LightControlLike, LightControlProperties, LineDirection, LockControlLike, LockControlProperties, LoggerService, ModelSpec, MotionDetectionInterface, MotionDetectionPluginResponse, MotionDetectionSettings, MotionResolution, MotionResult, MotionSensorLike, MotionSensorProperties, Notification, NotificationManager, NotifierDevice, NotifierInterface, OAuthAuthCodeFlowCapable, OAuthCapable, OAuthClientCredentialsCapable, OAuthDeviceFlowCapable, OAuthMetadata, OAuthProviderConfig, OAuthProviderDeclaration, OAuthState, OAuthStatus, ObjectDetectionInterface, ObjectDetectionPluginResponse, ObjectDetectionSettings, ObjectModelSpec, ObjectResult, ObjectSensorLike, ObjectSensorProperties, OccupancySensorLike, OccupancySensorProperties, OperatorFn, PTZControlLike, PTZControlProperties, PTZDirection, PTZPosition, PluginAPI, PluginAssignments, PluginConfig, PluginContract, PluginInfo, PluginInterfaces, Point, ProbeAudioCodec, ProbeConfig, ProbeStream, PropertyChangeOf, PtzAutotrackSettings, PythonVersion, RTPInfo, RTSPAudioCodec, RTSPUrlOptions, RtpSession, RtpSessionBackchannelOptions, RtpSessionOptions, SchemaCondition, SchemaConditionOperator, SchemaConfig, SecuritySystemLike, SecuritySystemProperties, SensorCapability, SensorLike, SensorPropertyType, SensorTriggerRef, SensorTriggerSettings, SirenControlLike, SirenControlProperties, SmokeSensorLike, SmokeSensorProperties, SnapshotInterface, SnapshotSettings, SnapshotUrlOptions, StreamDirection, StreamUrls, StreamingInterface, StreamingRole, SwitchControlLike, SwitchControlProperties, TemperatureInfoLike, TemperatureInfoProperties, ToastMessage, TrackedDetection, VideoCodec, VideoCodecProperties, VideoFFmpegCodec, VideoFrameData, VideoInputSpec, VideoStreamInfo, VideoStreamingMode, ZoneFilter, ZoneType };