@remotion/gif 4.0.423 → 4.0.424

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/cjs/Gif.js CHANGED
@@ -13,7 +13,7 @@ const GifForRendering_1 = require("./GifForRendering");
13
13
  exports.Gif = (0, react_1.forwardRef)((props, ref) => {
14
14
  const env = (0, remotion_1.useRemotionEnvironment)();
15
15
  if (env.isRendering) {
16
- return (0, jsx_runtime_1.jsx)(GifForRendering_1.GifForRendering, { ...props, ref: ref });
16
+ return jsx_runtime_1.jsx(GifForRendering_1.GifForRendering, { ...props, ref: ref });
17
17
  }
18
- return (0, jsx_runtime_1.jsx)(GifForDevelopment_1.GifForDevelopment, { ...props, ref: ref });
18
+ return jsx_runtime_1.jsx(GifForDevelopment_1.GifForDevelopment, { ...props, ref: ref });
19
19
  });
@@ -75,5 +75,5 @@ exports.GifForDevelopment = (0, react_1.forwardRef)(({ src, width, height, onErr
75
75
  if (index === -1) {
76
76
  return null;
77
77
  }
78
- return ((0, jsx_runtime_1.jsx)(canvas_1.Canvas, { fit: fit, index: index, frames: state.frames, width: width, height: height, ...props, ref: ref }));
78
+ return (jsx_runtime_1.jsx(canvas_1.Canvas, { fit: fit, index: index, frames: state.frames, width: width, height: height, ...props, ref: ref }));
79
79
  });
@@ -103,5 +103,5 @@ exports.GifForRendering = (0, react_1.forwardRef)(({ src, width, height, onLoad,
103
103
  if (index === -1) {
104
104
  return null;
105
105
  }
106
- return ((0, jsx_runtime_1.jsx)(canvas_1.Canvas, { fit: fit, index: index, frames: state.frames, width: width, height: height, ...props, ref: ref }));
106
+ return (jsx_runtime_1.jsx(canvas_1.Canvas, { fit: fit, index: index, frames: state.frames, width: width, height: height, ...props, ref: ref }));
107
107
  });
@@ -93,5 +93,5 @@ exports.Canvas = (0, react_1.forwardRef)(({ index, frames, width, height, fit, c
93
93
  ctx.drawImage(tempCtx.canvas, ...calcArgs(fit, imageData, { width: size.width, height: size.height }));
94
94
  }
95
95
  }, [index, frames, fit, tempCtx, size]);
96
- return ((0, jsx_runtime_1.jsx)("canvas", { ref: canvasRef, className: className, style: style, width: width !== null && width !== void 0 ? width : size === null || size === void 0 ? void 0 : size.width, height: height !== null && height !== void 0 ? height : size === null || size === void 0 ? void 0 : size.height }));
96
+ return (jsx_runtime_1.jsx("canvas", { ref: canvasRef, className: className, style: style, width: width !== null && width !== void 0 ? width : size === null || size === void 0 ? void 0 : size.width, height: height !== null && height !== void 0 ? height : size === null || size === void 0 ? void 0 : size.height }));
97
97
  });
package/dist/cjs/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.preloadGif = exports.Gif = exports.getGifDurationInSeconds = void 0;
4
- var get_gif_duration_in_seconds_1 = require("./get-gif-duration-in-seconds");
4
+ const get_gif_duration_in_seconds_1 = require("./get-gif-duration-in-seconds");
5
5
  Object.defineProperty(exports, "getGifDurationInSeconds", { enumerable: true, get: function () { return get_gif_duration_in_seconds_1.getGifDurationInSeconds; } });
6
- var Gif_1 = require("./Gif");
6
+ const Gif_1 = require("./Gif");
7
7
  Object.defineProperty(exports, "Gif", { enumerable: true, get: function () { return Gif_1.Gif; } });
8
- var preload_gif_1 = require("./preload-gif");
8
+ const preload_gif_1 = require("./preload-gif");
9
9
  Object.defineProperty(exports, "preloadGif", { enumerable: true, get: function () { return preload_gif_1.preloadGif; } });
@@ -1,16 +1,17 @@
1
1
  import type { ParsedGif } from '../gifuct/types';
2
2
  import type { Stream } from './uint8-parser';
3
- export declare const GIF: (((stream: Stream, result: ParsedGif, parent: ParsedGif, parseFn: (st: Stream, schema: import("./parser").GifSchema, result: ParsedGif, parent: ParsedGif) => void) => void) | {
3
+ export declare const GIF: (((stream: Stream, result: ParsedGif, parent: ParsedGif, parseFn: (st: Stream, schema: unknown, result: ParsedGif, parent: ParsedGif) => void) => void) | {
4
4
  header: ({
5
5
  signature: (stream: Stream) => string;
6
6
  version?: undefined;
7
7
  } | {
8
- version: (stream: Stream) => string;
9
8
  signature?: undefined;
9
+ version: (stream: Stream) => string;
10
10
  })[];
11
11
  lsd?: undefined;
12
12
  frames?: undefined;
13
13
  } | {
14
+ header?: undefined;
14
15
  lsd: ({
15
16
  width: (stream: Stream) => number;
16
17
  height?: undefined;
@@ -18,34 +19,33 @@ export declare const GIF: (((stream: Stream, result: ParsedGif, parent: ParsedGi
18
19
  backgroundColorIndex?: undefined;
19
20
  pixelAspectRatio?: undefined;
20
21
  } | {
21
- height: (stream: Stream) => number;
22
22
  width?: undefined;
23
+ height: (stream: Stream) => number;
23
24
  gct?: undefined;
24
25
  backgroundColorIndex?: undefined;
25
26
  pixelAspectRatio?: undefined;
26
27
  } | {
27
- gct: (stream: Stream) => Record<string, number | boolean>;
28
28
  width?: undefined;
29
29
  height?: undefined;
30
+ gct: (stream: Stream) => Record<string, number | boolean>;
30
31
  backgroundColorIndex?: undefined;
31
32
  pixelAspectRatio?: undefined;
32
33
  } | {
33
- backgroundColorIndex: (stream: Stream) => number;
34
34
  width?: undefined;
35
35
  height?: undefined;
36
36
  gct?: undefined;
37
+ backgroundColorIndex: (stream: Stream) => number;
37
38
  pixelAspectRatio?: undefined;
38
39
  } | {
39
- pixelAspectRatio: (stream: Stream) => number;
40
40
  width?: undefined;
41
41
  height?: undefined;
42
42
  gct?: undefined;
43
43
  backgroundColorIndex?: undefined;
44
+ pixelAspectRatio: (stream: Stream) => number;
44
45
  })[];
45
- header?: undefined;
46
46
  frames?: undefined;
47
47
  } | {
48
- frames: (stream: Stream, result: unknown, parent: unknown, _parse: (st: Stream, schema: import("./parser").GifSchema, result: unknown, parent: unknown) => void) => unknown[];
49
48
  header?: undefined;
50
49
  lsd?: undefined;
50
+ frames: (stream: Stream, result: unknown, parent: unknown, _parse: (st: Stream, schema: unknown, result: unknown, parent: unknown) => void) => unknown[];
51
51
  })[];
@@ -1,9 +1,9 @@
1
1
  import type { ParsedGif } from '../gifuct/types';
2
2
  import type { Stream } from './uint8-parser';
3
- export declare const parse: <T extends Record<string, T>>(stream: Stream, schema: GifSchema, result?: T, parent?: T) => GifSchema;
4
- export declare const loop: <R>(schema: GifSchema, continueFunc: (st: Stream, r: R, p: R) => boolean) => (stream: Stream, result: R, parent: R, _parse: ParseFn<R>) => R[];
3
+ export declare const parse: <T extends Record<string, T>>(stream: Stream, schema: unknown, result?: T, parent?: T) => unknown;
4
+ export declare const loop: <R>(schema: unknown, continueFunc: (st: Stream, r: R, p: R) => boolean) => (stream: Stream, result: R, parent: R, _parse: ParseFn<R>) => R[];
5
5
  type ConditionalFunction<T> = (st: Stream, result: T, parent: T) => boolean;
6
6
  type ParseFn<T> = (st: Stream, schema: GifSchema, result: T, parent: T) => void;
7
7
  export type GifSchema = unknown | ParsedGif;
8
- export declare const conditional: <T>(schema: GifSchema, conditionFunc: ConditionalFunction<T>) => (stream: Stream, result: T, parent: T, parseFn: ParseFn<T>) => void;
8
+ export declare const conditional: <T>(schema: unknown, conditionFunc: ConditionalFunction<T>) => (stream: Stream, result: T, parent: T, parseFn: ParseFn<T>) => void;
9
9
  export {};
@@ -1,9 +1,8 @@
1
- import type { GifSchema } from './parser';
2
1
  export type Stream = {
3
2
  data: Uint8Array;
4
3
  pos: number;
5
4
  };
6
- export declare const buildStream: (uint8Data: Uint8Array) => {
5
+ export declare const buildStream: (uint8Data: Uint8Array<ArrayBufferLike>) => {
7
6
  data: Uint8Array<ArrayBufferLike>;
8
7
  pos: number;
9
8
  };
@@ -14,4 +13,4 @@ export declare const peekBytes: (length: number) => (stream: Stream) => Uint8Arr
14
13
  export declare const readString: (length: number) => (stream: Stream) => string;
15
14
  export declare const readUnsigned: (littleEndian: boolean) => (stream: Stream) => number;
16
15
  export declare const readArray: <T>(byteSize: number, totalOrFunc: number | ((st: Stream, r: T, p: T) => number)) => (stream: Stream, result: T, parent: T) => any[];
17
- export declare const readBits: (schema: GifSchema) => (stream: Stream) => Record<string, number | boolean>;
16
+ export declare const readBits: (schema: unknown) => (stream: Stream) => Record<string, number | boolean>;
@@ -21,7 +21,10 @@ export interface Options<KeyType, ValueType> {
21
21
  */
22
22
  onEviction?: (key: KeyType, value: ValueType) => void;
23
23
  }
24
- export declare class QuickLRU<KeyType, ValueType> implements Iterable<[KeyType, ValueType]> {
24
+ export declare class QuickLRU<KeyType, ValueType> implements Iterable<[
25
+ KeyType,
26
+ ValueType
27
+ ]> {
25
28
  /**
26
29
  The maximum number of milliseconds an item should remain in the cache.
27
30
 
@@ -2,6 +2,30 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.QuickLRU = void 0;
4
4
  class QuickLRU {
5
+ /**
6
+ The maximum number of milliseconds an item should remain in the cache.
7
+
8
+ @default Infinity
9
+
10
+ By default, `maxAge` will be `Infinity`, which means that items will never expire.
11
+ Lazy expiration upon the next write or read call.
12
+
13
+ Individual expiration of an item can be specified by the `set(key, value, maxAge)` method.
14
+ */
15
+ maxAge;
16
+ /**
17
+ The maximum number of items before evicting the least recently used items.
18
+ */
19
+ maxSize;
20
+ /**
21
+ Called right before an item is evicted from the cache.
22
+
23
+ Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`).
24
+ */
25
+ onEviction;
26
+ _size;
27
+ cache;
28
+ oldCache;
5
29
  /**
6
30
  Simple ["Least Recently Used" (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29).
7
31
 
@@ -1,12 +1,12 @@
1
1
  import type { GifState } from './props';
2
2
  export declare const parse: (src: string, { signal, }: {
3
- signal: AbortController["signal"];
3
+ signal: AbortSignal;
4
4
  }) => Promise<{
5
+ width: number;
6
+ height: number;
5
7
  loaded: boolean;
6
8
  delays: number[];
7
9
  frames: Uint8ClampedArray<ArrayBufferLike>[];
8
- width: number;
9
- height: number;
10
10
  }>;
11
11
  type ParserCallbackArgs = {
12
12
  width: number;
@@ -3,4 +3,4 @@ export type Size = {
3
3
  height: number;
4
4
  };
5
5
  export declare const updateAllElementsSizes: () => void;
6
- export declare const useElementSize: (ref: React.RefObject<HTMLElement | null>) => Size | null;
6
+ export declare const useElementSize: (ref: import("react").RefObject<HTMLElement | null>) => Size | null;
@@ -1,5 +1,5 @@
1
1
  import type { GifLoopBehavior } from './props';
2
- export declare function useCurrentGifIndex({ delays, loopBehavior, playbackRate, }: {
2
+ export declare function useCurrentGifIndex({ delays, loopBehavior, playbackRate }: {
3
3
  delays: number[];
4
4
  loopBehavior: GifLoopBehavior;
5
5
  playbackRate: number;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/gif"
4
4
  },
5
5
  "name": "@remotion/gif",
6
- "version": "4.0.423",
6
+ "version": "4.0.424",
7
7
  "description": "Embed GIFs in a Remotion video",
8
8
  "sideEffects": false,
9
9
  "bugs": {
@@ -17,7 +17,7 @@
17
17
  "scripts": {
18
18
  "formatting": "prettier --experimental-cli src --check",
19
19
  "lint": "eslint src",
20
- "make": "tsc -d && node build.mjs && bun --env-file=../.env.bundle bundle.ts"
20
+ "make": "tsgo -d && node build.mjs && bun --env-file=../.env.bundle bundle.ts"
21
21
  },
22
22
  "exports": {
23
23
  "./package.json": "./package.json",
@@ -29,15 +29,16 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "remotion": "4.0.423"
32
+ "remotion": "4.0.424"
33
33
  },
34
34
  "devDependencies": {
35
35
  "esbuild": "0.25.0",
36
36
  "react": "19.2.3",
37
37
  "react-dom": "19.2.3",
38
38
  "webpack": "5.105.0",
39
- "@remotion/eslint-config-internal": "4.0.423",
40
- "eslint": "9.19.0"
39
+ "@remotion/eslint-config-internal": "4.0.424",
40
+ "eslint": "9.19.0",
41
+ "@typescript/native-preview": "7.0.0-dev.20260217.1"
41
42
  },
42
43
  "peerDependencies": {
43
44
  "react": ">=16.8.0",