@sealpixel/core 1.0.0-rc.12 → 1.0.0-rc.15

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.
Files changed (83) hide show
  1. package/dist/assets.d.ts +0 -1
  2. package/dist/assets.js.map +1 -1
  3. package/dist/canonical-json.d.ts +0 -1
  4. package/dist/canonical-json.js.map +1 -1
  5. package/dist/compile.d.ts +0 -1
  6. package/dist/compile.js.map +1 -1
  7. package/dist/embedded.d.ts +0 -1
  8. package/dist/embedded.js.map +1 -1
  9. package/dist/errors.d.ts +1 -2
  10. package/dist/errors.js.map +1 -1
  11. package/dist/external-kernel.d.ts +0 -1
  12. package/dist/external-kernel.js.map +1 -1
  13. package/dist/generated/geometry.d.ts +1 -2
  14. package/dist/generated/geometry.js.map +1 -1
  15. package/dist/generated/output.d.ts +0 -1
  16. package/dist/generated/output.js.map +1 -1
  17. package/dist/generated/plan.d.ts +3 -4
  18. package/dist/generated/plan.js.map +1 -1
  19. package/dist/history.d.ts +0 -1
  20. package/dist/history.js.map +1 -1
  21. package/dist/image-size.d.ts +0 -1
  22. package/dist/image-size.js.map +1 -1
  23. package/dist/index.d.ts +1 -2
  24. package/dist/index.js.map +1 -1
  25. package/dist/inline-renderer.d.ts +2 -3
  26. package/dist/inline-renderer.js +4 -4
  27. package/dist/inline-renderer.js.map +1 -1
  28. package/dist/options.d.ts +0 -1
  29. package/dist/options.js.map +1 -1
  30. package/dist/plan.d.ts +0 -1
  31. package/dist/plan.js +1 -1
  32. package/dist/plan.js.map +1 -1
  33. package/dist/plugin.d.ts +0 -1
  34. package/dist/plugin.js.map +1 -1
  35. package/dist/registry.d.ts +0 -1
  36. package/dist/registry.js.map +1 -1
  37. package/dist/render.d.ts +0 -1
  38. package/dist/render.js +1 -1
  39. package/dist/render.js.map +1 -1
  40. package/dist/renderer-core.d.ts +15 -15
  41. package/dist/renderer-core.js +27 -19
  42. package/dist/renderer-core.js.map +1 -1
  43. package/dist/renderer.d.ts +3 -4
  44. package/dist/renderer.js.map +1 -1
  45. package/dist/session.d.ts +20 -71
  46. package/dist/session.js +16 -198
  47. package/dist/session.js.map +1 -1
  48. package/dist/types.d.ts +3 -3
  49. package/dist/types.js.map +1 -1
  50. package/dist/worker-protocol.d.ts +6 -7
  51. package/dist/worker-protocol.js.map +1 -1
  52. package/dist/worker-renderer.d.ts +2 -3
  53. package/dist/worker-renderer.js +8 -4
  54. package/dist/worker-renderer.js.map +1 -1
  55. package/dist/worker.d.ts +0 -1
  56. package/dist/worker.js +5 -5
  57. package/dist/worker.js.map +1 -1
  58. package/package.json +2 -2
  59. package/dist/assets.d.ts.map +0 -1
  60. package/dist/canonical-json.d.ts.map +0 -1
  61. package/dist/compile.d.ts.map +0 -1
  62. package/dist/embedded.d.ts.map +0 -1
  63. package/dist/errors.d.ts.map +0 -1
  64. package/dist/external-kernel.d.ts.map +0 -1
  65. package/dist/generated/geometry.d.ts.map +0 -1
  66. package/dist/generated/output.d.ts.map +0 -1
  67. package/dist/generated/plan.d.ts.map +0 -1
  68. package/dist/history.d.ts.map +0 -1
  69. package/dist/image-size.d.ts.map +0 -1
  70. package/dist/index.d.ts.map +0 -1
  71. package/dist/inline-renderer.d.ts.map +0 -1
  72. package/dist/options.d.ts.map +0 -1
  73. package/dist/plan.d.ts.map +0 -1
  74. package/dist/plugin.d.ts.map +0 -1
  75. package/dist/registry.d.ts.map +0 -1
  76. package/dist/render.d.ts.map +0 -1
  77. package/dist/renderer-core.d.ts.map +0 -1
  78. package/dist/renderer.d.ts.map +0 -1
  79. package/dist/session.d.ts.map +0 -1
  80. package/dist/types.d.ts.map +0 -1
  81. package/dist/worker-protocol.d.ts.map +0 -1
  82. package/dist/worker-renderer.d.ts.map +0 -1
  83. package/dist/worker.d.ts.map +0 -1
package/dist/render.d.ts CHANGED
@@ -22,4 +22,3 @@ export interface PipelineOptions {
22
22
  export declare function runPipeline(wasm: SealpixelWasm, registry: Registry, image: RgbaBuffer, log: EditLog, options: PipelineOptions): Promise<RgbaBuffer>;
23
23
  /** Maps the public output options onto the Rust `OutputOptions` JSON. */
24
24
  export declare function toCoreOutput(output: OutputOptions): Record<string, unknown>;
25
- //# sourceMappingURL=render.d.ts.map
package/dist/render.js CHANGED
@@ -83,7 +83,7 @@ export async function runPipeline(wasm, registry, image, log, options) {
83
83
  const plan = {
84
84
  version: PLAN_VERSION,
85
85
  source: currentLogical,
86
- proxyScale: current.width / currentLogical.width,
86
+ bufferScale: current.width / currentLogical.width,
87
87
  stages: toCoreStages(segment.stages),
88
88
  };
89
89
  const planJson = JSON.stringify(plan);
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAuC,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAsB,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAiB,YAAY,EAAmB,MAAM,WAAW,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAiB,MAAM,eAAe,CAAC;AAU9D,MAAM,cAAc,GAAiC;IACnD,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;CACrB,CAAC;AAEF,MAAM,cAAc,GAAG,cAAc,CAAC,EAAE,CAAC,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,MAAoB,EACpB,GAAY,EACZ,OAAsB;IAEtB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,CAAC,MAAM,iBAAiB,EAAE,CAAC,CAAC;IACzD,MAA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AM,EAAE,OAAO;QAAE,MAAM,IAAI,cAAc,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,GAAG;IACV,OAAO,OAAO,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC;AAC7E,CAAC","sourcesContent":["import { loadSealpixelWasm, type RgbaBuffer, type SealpixelWasm } from '@sealpixel/wasm';\nimport { withAssets } from './assets.js';\nimport { canonicalJson } from './canonical-json.js';\nimport { compile, type PipelineStage, toCoreStages, toPipeline } from './compile.js';\nimport { SealpixelError } from './errors.js';\nimport { runExternalKernel } from './external-kernel.js';\nimport { type Geometry, PLAN_VERSION, type RenderPlan } from './plan.js';\nimport type { KernelContext, PlanContext } from './plugin.js';\nimport { createRegistry, type Registry } from './registry.js';\nimport type {\n EditLog,\n OutputFormat,\n OutputOptions,\n RenderOptions,\n RenderResult,\n RenderSource,\n} from './types.js';\n\nconst FORMAT_TO_CORE: Record<OutputFormat, string> = {\n 'image/png': 'png',\n 'image/jpeg': 'jpeg',\n 'image/webp': 'webp',\n};\n\nconst EMPTY_REGISTRY = createRegistry([]);\n\n/**\n * Renders `log` against `source` and encodes the result.\n *\n * Pure with respect to its inputs: same bytes, same log, same options, same\n * plugins and the same core version produce the same output bytes on every\n * runtime. Core stages run inside the wasm; JS kernels run between them\n * through the same orchestrator on every runtime.\n */\nexport async function render(\n source: RenderSource,\n log: EditLog,\n options: RenderOptions,\n): Promise<RenderResult> {\n const wasm = options.wasm ?? (await loadSealpixelWasm());\n const registry = options.registry ?? EMPTY_REGISTRY;\n throwIfAborted(options.signal);\n\n const t0 = now();\n const image = source instanceof Uint8Array ? tryCore(() => wasm.decode(source)) : source;\n const decodeMs = now() - t0;\n\n const mode = options.mode ?? 'truth';\n if (\n mode === 'truth' &&\n (image.width !== log.source.width || image.height !== log.source.height)\n ) {\n throw new SealpixelError(\n 'SOURCE_MISMATCH',\n `truth render expects ${log.source.width}x${log.source.height}, got ${image.width}x${image.height}`,\n );\n }\n if (log.ops.length > 0 && registry === EMPTY_REGISTRY) {\n throw new SealpixelError('INVALID_EDIT_LOG', 'log has ops but no registry was given');\n }\n throwIfAborted(options.signal);\n\n const t1 = now();\n const rendered = await withAssets(\n () =>\n runPipeline(wasm, registry, image, log, {\n mode,\n ...(options.upTo === undefined ? {} : { upTo: options.upTo }),\n ...(options.signal === undefined ? {} : { signal: options.signal }),\n }),\n options.assets,\n (id, bytes) => wasm.assetPut(id, bytes),\n );\n const renderMs = now() - t1;\n throwIfAborted(options.signal);\n\n const t2 = now();\n const coreOutput = toCoreOutput(options.output);\n if (options.embedEditLog) {\n coreOutput['embed'] = canonicalJson({ log, index: options.upTo ?? log.ops.length });\n }\n const bytes = tryCore(() => wasm.encode(rendered, JSON.stringify(coreOutput)));\n const encodeMs = now() - t2;\n\n return {\n bytes,\n mimeType: options.output.format,\n width: rendered.width,\n height: rendered.height,\n hash: wasm.sha256Hex(bytes),\n coreVersion: wasm.version(),\n timings: { decode: decodeMs, render: renderMs, encode: encodeMs },\n };\n}\n\nexport interface PipelineOptions {\n mode: 'truth' | 'preview';\n upTo?: number;\n signal?: AbortSignal;\n}\n\n/**\n * Compiles the log and executes it: consecutive core stages become one wasm\n * call, every external kernel runs in between on the RGBA buffer.\n */\nexport async function runPipeline(\n wasm: SealpixelWasm,\n registry: Registry,\n image: RgbaBuffer,\n log: EditLog,\n options: PipelineOptions,\n): Promise<RgbaBuffer> {\n const doc = compile(log, registry, options.upTo);\n const logical = { width: log.source.width, height: log.source.height };\n const ctx: PlanContext = {\n logical,\n actual: { width: image.width, height: image.height },\n scale: image.width / log.source.width,\n mode: options.mode,\n };\n const stages = toPipeline(doc, registry, ctx);\n\n let current = image;\n let currentLogical = logical;\n for (const segment of segments(stages)) {\n throwIfAborted(options.signal);\n if (segment.kind === 'core') {\n const plan: RenderPlan = {\n version: PLAN_VERSION,\n source: currentLogical,\n bufferScale: current.width / currentLogical.width,\n stages: toCoreStages(segment.stages),\n };\n const planJson = JSON.stringify(plan);\n const geometry = JSON.parse(\n tryCore(() => wasm.resolveGeometry(planJson, current.width, current.height)),\n ) as Geometry;\n current = tryCore(() => wasm.renderRgba(current, planJson));\n currentLogical = geometry.logicalOut;\n } else {\n const stage = segment.stage;\n const kctx: KernelContext = {\n logical: currentLogical,\n actual: { width: current.width, height: current.height },\n scale: current.width / currentLogical.width,\n mode: options.mode,\n asset: (id) => {\n throw new SealpixelError(\n 'INVALID_EDIT_LOG',\n `asset \"${id}\" requested but assets are not supported yet (S3.3)`,\n );\n },\n signal: options.signal ?? new AbortController().signal,\n };\n const out = await runExternalKernel(stage.plugin, current, stage.params, kctx);\n if (out.width !== current.width || out.height !== current.height) {\n currentLogical = {\n width: Math.round(currentLogical.width * (out.width / current.width)),\n height: Math.round(currentLogical.height * (out.height / current.height)),\n };\n }\n current = out;\n }\n }\n return current;\n}\n\ntype Segment =\n | { kind: 'core'; stages: PipelineStage[] }\n | { kind: 'external'; stage: Extract<PipelineStage, { kind: 'js' | 'wasm' }> };\n\nfunction* segments(stages: PipelineStage[]): Generator<Segment> {\n let run: PipelineStage[] = [];\n for (const stage of stages) {\n if (stage.kind === 'core') {\n run.push(stage);\n continue;\n }\n if (run.length > 0) {\n yield { kind: 'core', stages: run };\n run = [];\n }\n yield { kind: 'external', stage };\n }\n if (run.length > 0) yield { kind: 'core', stages: run };\n}\n\n/** Maps the public output options onto the Rust `OutputOptions` JSON. */\nexport function toCoreOutput(output: OutputOptions): Record<string, unknown> {\n const core: Record<string, unknown> = { format: FORMAT_TO_CORE[output.format] };\n if (output.quality !== undefined) core['quality'] = output.quality;\n if (output.progressive !== undefined) core['progressive'] = output.progressive;\n if (output.chromaSubsampling !== undefined) core['chromaSubsampling'] = output.chromaSubsampling;\n if (output.lossless !== undefined) core['lossless'] = output.lossless;\n if (output.background !== undefined) core['background'] = output.background;\n return core;\n}\n\nfunction tryCore<T>(fn: () => T): T {\n try {\n return fn();\n } catch (error) {\n throw SealpixelError.from(error);\n }\n}\n\nfunction throwIfAborted(signal: AbortSignal | undefined): void {\n if (signal?.aborted) throw new SealpixelError('ABORTED', 'render aborted');\n}\n\nfunction now(): number {\n return typeof performance === 'undefined' ? Date.now() : performance.now();\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The renderer's logic, independent of where it runs. `startSealpixelWorker`
3
3
  * wraps it behind a message protocol; `InlineRenderer` calls it directly.
4
- * It owns the decoded source, the proxy, and a per-stage preview cache.
4
+ * It owns the decoded source, the working copy, and a per-stage preview cache.
5
5
  */
6
6
  import type { RgbaBuffer, SealpixelWasm } from '@sealpixel/wasm';
7
7
  import { type Geometry } from './plan.js';
@@ -12,12 +12,12 @@ export interface LoadedSource {
12
12
  descriptor: SourceDescriptor;
13
13
  /** Full-resolution pixels are kept only when under the megapixel limit. */
14
14
  resident: boolean;
15
- proxy: RgbaBuffer;
15
+ workingCopy: RgbaBuffer;
16
16
  }
17
17
  export interface RenderRequest {
18
18
  log: EditLog;
19
- /** `proxy` renders on the proxy in preview mode; `full` renders the resident source in truth mode. */
20
- target: 'proxy' | 'full';
19
+ /** `workingCopy` renders on the working copy in preview mode; `full` renders the resident source in truth mode. */
20
+ target: 'workingCopy' | 'full';
21
21
  upTo?: number;
22
22
  signal?: AbortSignal;
23
23
  }
@@ -28,7 +28,8 @@ export interface ExportRequest {
28
28
  embedEditLog?: boolean;
29
29
  }
30
30
  export interface ExportResult {
31
- bytes: Uint8Array;
31
+ /** Backed by a plain `ArrayBuffer`, so it is a `BlobPart`. */
32
+ bytes: Uint8Array<ArrayBuffer>;
32
33
  mimeType: OutputOptions['format'];
33
34
  width: number;
34
35
  height: number;
@@ -38,8 +39,8 @@ export interface RendererCoreOptions {
38
39
  plugins: readonly AnyPlugin[];
39
40
  /** Full-resolution pixels above this are not kept after loading. `RendererLoadOptions` overrides it per load. */
40
41
  maxClientMegapixels: number;
41
- /** Longest side of the preview proxy. */
42
- proxyMaxSide: number;
42
+ /** Longest side of the preview working copy. */
43
+ workingCopyMaxSide: number;
43
44
  /** Cached stage outputs kept for the preview pipeline. */
44
45
  cacheEntries?: number;
45
46
  }
@@ -53,7 +54,7 @@ export declare class RendererCore {
53
54
  readonly registry: Registry;
54
55
  private readonly options;
55
56
  private full;
56
- private proxy;
57
+ private workingCopy;
57
58
  private descriptor;
58
59
  private readonly cache;
59
60
  constructor(wasm: SealpixelWasm, options: RendererCoreOptions);
@@ -63,19 +64,19 @@ export declare class RendererCore {
63
64
  coreVersion: string;
64
65
  plugins: Record<string, number>;
65
66
  };
66
- /** Decodes `bytes`, derives the descriptor and proxy, and drops the full image when too large. */
67
+ /** Decodes `bytes`, derives the descriptor and working copy, and drops the full image when too large. */
67
68
  load(bytes: Uint8Array, id: string, loadOptions?: RendererLoadOptions): LoadedSource;
68
- /** Decodes an encoded proxy (for example one the server produced) and uses it as the preview source. */
69
- loadProxyEncoded(bytes: Uint8Array, descriptor: SourceDescriptor): LoadedSource;
70
- /** Accepts pixels decoded elsewhere (native proxy strategy). Never resident. */
71
- loadProxy(proxy: RgbaBuffer, descriptor: SourceDescriptor): LoadedSource;
69
+ /** Decodes an encoded working copy (for example one the host built elsewhere) and uses it as the preview source. */
70
+ loadWorkingCopyEncoded(bytes: Uint8Array, descriptor: SourceDescriptor): LoadedSource;
71
+ /** Accepts pixels decoded elsewhere, for example by a native decoder. Never resident. */
72
+ loadWorkingCopy(workingCopy: RgbaBuffer, descriptor: SourceDescriptor): LoadedSource;
72
73
  hasSource(): boolean;
73
74
  isResident(): boolean;
74
75
  unload(): void;
75
76
  /** Renders the log. Preview renders are split per stage and cached by prefix. */
76
77
  render(req: RenderRequest): Promise<RgbaBuffer>;
77
78
  export(req: ExportRequest): Promise<ExportResult>;
78
- geometry(log: EditLog, target: 'proxy' | 'full', upTo?: number): Geometry;
79
+ geometry(log: EditLog, target: 'workingCopy' | 'full', upTo?: number): Geometry;
79
80
  private require;
80
81
  private runStages;
81
82
  /** Recomputes the logical size after a cached stage by asking the core for its geometry. */
@@ -84,4 +85,3 @@ export declare class RendererCore {
84
85
  /** For tests: number of cached stage outputs. */
85
86
  cacheSize(): number;
86
87
  }
87
- //# sourceMappingURL=renderer-core.d.ts.map
@@ -10,7 +10,7 @@ export class RendererCore {
10
10
  registry;
11
11
  options;
12
12
  full = null;
13
- proxy = null;
13
+ workingCopy = null;
14
14
  descriptor = null;
15
15
  cache = new Map();
16
16
  constructor(wasm, options) {
@@ -27,7 +27,7 @@ export class RendererCore {
27
27
  info() {
28
28
  return { coreVersion: this.wasm.version(), plugins: this.registry.pluginVersions() };
29
29
  }
30
- /** Decodes `bytes`, derives the descriptor and proxy, and drops the full image when too large. */
30
+ /** Decodes `bytes`, derives the descriptor and working copy, and drops the full image when too large. */
31
31
  load(bytes, id, loadOptions = {}) {
32
32
  const decoded = this.wasm.decode(bytes);
33
33
  const hash = this.wasm.sha256Hex(bytes);
@@ -41,24 +41,32 @@ export class RendererCore {
41
41
  const megapixels = (decoded.width * decoded.height) / 1e6;
42
42
  const maxClientMegapixels = loadOptions.maxClientMegapixels ?? this.options.maxClientMegapixels;
43
43
  const resident = megapixels <= maxClientMegapixels;
44
- const proxy = this.wasm.resizeProxy(decoded, this.options.proxyMaxSide);
44
+ const workingCopy = this.wasm.resizeWorkingCopy(decoded, this.options.workingCopyMaxSide);
45
45
  this.full = resident ? decoded : null;
46
- this.proxy = proxy;
46
+ this.workingCopy = workingCopy;
47
47
  this.descriptor = descriptor;
48
48
  this.cache.clear();
49
- return { descriptor, resident, proxy: { ...proxy, data: new Uint8Array(proxy.data) } };
49
+ return {
50
+ descriptor,
51
+ resident,
52
+ workingCopy: { ...workingCopy, data: new Uint8Array(workingCopy.data) },
53
+ };
50
54
  }
51
- /** Decodes an encoded proxy (for example one the server produced) and uses it as the preview source. */
52
- loadProxyEncoded(bytes, descriptor) {
53
- return this.loadProxy(this.wasm.decode(bytes), descriptor);
55
+ /** Decodes an encoded working copy (for example one the host built elsewhere) and uses it as the preview source. */
56
+ loadWorkingCopyEncoded(bytes, descriptor) {
57
+ return this.loadWorkingCopy(this.wasm.decode(bytes), descriptor);
54
58
  }
55
- /** Accepts pixels decoded elsewhere (native proxy strategy). Never resident. */
56
- loadProxy(proxy, descriptor) {
59
+ /** Accepts pixels decoded elsewhere, for example by a native decoder. Never resident. */
60
+ loadWorkingCopy(workingCopy, descriptor) {
57
61
  this.full = null;
58
- this.proxy = proxy;
62
+ this.workingCopy = workingCopy;
59
63
  this.descriptor = descriptor;
60
64
  this.cache.clear();
61
- return { descriptor, resident: false, proxy: { ...proxy, data: new Uint8Array(proxy.data) } };
65
+ return {
66
+ descriptor,
67
+ resident: false,
68
+ workingCopy: { ...workingCopy, data: new Uint8Array(workingCopy.data) },
69
+ };
62
70
  }
63
71
  hasSource() {
64
72
  return this.descriptor !== null;
@@ -68,17 +76,17 @@ export class RendererCore {
68
76
  }
69
77
  unload() {
70
78
  this.full = null;
71
- this.proxy = null;
79
+ this.workingCopy = null;
72
80
  this.descriptor = null;
73
81
  this.cache.clear();
74
82
  }
75
83
  /** Renders the log. Preview renders are split per stage and cached by prefix. */
76
84
  async render(req) {
77
85
  const { descriptor } = this.require();
78
- const image = req.target === 'full' ? this.full : this.proxy;
86
+ const image = req.target === 'full' ? this.full : this.workingCopy;
79
87
  if (!image) {
80
88
  throw new SealpixelError('SOURCE_MISMATCH', req.target === 'full'
81
- ? 'full-resolution pixels are not resident; use a server render'
89
+ ? 'full-resolution pixels are not resident; render the original outside the browser'
82
90
  : 'no source loaded');
83
91
  }
84
92
  const mode = req.target === 'full' ? 'truth' : 'preview';
@@ -114,7 +122,7 @@ export class RendererCore {
114
122
  }
115
123
  geometry(log, target, upTo) {
116
124
  const { descriptor } = this.require();
117
- const image = (target === 'full' ? this.full : this.proxy) ?? this.proxy;
125
+ const image = (target === 'full' ? this.full : this.workingCopy) ?? this.workingCopy;
118
126
  if (!image)
119
127
  throw new SealpixelError('SOURCE_MISMATCH', 'no source loaded');
120
128
  const logical = { width: descriptor.width, height: descriptor.height };
@@ -129,7 +137,7 @@ export class RendererCore {
129
137
  const plan = {
130
138
  version: PLAN_VERSION,
131
139
  source: logical,
132
- proxyScale: image.width / logical.width,
140
+ bufferScale: image.width / logical.width,
133
141
  stages: toCoreStages(core),
134
142
  };
135
143
  return JSON.parse(this.wasm.resolveGeometry(JSON.stringify(plan), image.width, image.height));
@@ -157,7 +165,7 @@ export class RendererCore {
157
165
  const plan = {
158
166
  version: PLAN_VERSION,
159
167
  source: currentLogical,
160
- proxyScale: current.width / currentLogical.width,
168
+ bufferScale: current.width / currentLogical.width,
161
169
  stages: toCoreStages([stage]),
162
170
  };
163
171
  const planJson = JSON.stringify(plan);
@@ -203,7 +211,7 @@ export class RendererCore {
203
211
  const plan = {
204
212
  version: PLAN_VERSION,
205
213
  source: logicalIn,
206
- proxyScale: 1,
214
+ bufferScale: 1,
207
215
  stages: toCoreStages([stage]),
208
216
  };
209
217
  const g = JSON.parse(this.wasm.resolveGeometry(JSON.stringify(plan), logicalIn.width, logicalIn.height));
@@ -1 +1 @@
1
- {"version":3,"file":"renderer-core.js","sourceRoot":"","sources":["../src/renderer-core.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAsB,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAiB,YAAY,EAAmB,MAAM,WAAW,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAiB,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAiD3C,MAAM,OAAO,YAAY;IASZ;IARF,QAAQ,CAAW;IACX,OAAO,CAAsB;IACtC,IAAI,GAAsB,IAAI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,KAAK,CAAC,CAAC;SAC9B,CAAC;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAClB,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CACvE,CAAC;QACd,OAAO,CAAC,CAAC,UAAU,CAAC;IACtB,CAAC;IAEO,QAAQ,CAAC,GAAW,EAAE,KAAiB;QAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,CAAC;QAC7C,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,EAAE,CAAC;YAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;YAC9C,IAAI,MAAM,KAAK,SAAS;gBAAE,MAAM;YAChC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,iDAAiD;IACjD,SAAS;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;CACF","sourcesContent":["/**\n * The renderer's logic, independent of where it runs. `startSealpixelWorker`\n * wraps it behind a message protocol; `InlineRenderer` calls it directly.\n * It owns the decoded source, the working copy, and a per-stage preview cache.\n */\nimport type { RgbaBuffer, SealpixelWasm } from '@sealpixel/wasm';\nimport { canonicalJson } from './canonical-json.js';\nimport { compile, type PipelineStage, toCoreStages, toPipeline } from './compile.js';\nimport { SealpixelError } from './errors.js';\nimport { runExternalKernel } from './external-kernel.js';\nimport { type Geometry, PLAN_VERSION, type RenderPlan } from './plan.js';\nimport type { AnyPlugin, KernelContext, PlanContext } from './plugin.js';\nimport { createRegistry, type Registry } from './registry.js';\nimport { toCoreOutput } from './render.js';\nimport type { EditLog, OutputOptions, SourceDescriptor } from './types.js';\n\nexport interface LoadedSource {\n descriptor: SourceDescriptor;\n /** Full-resolution pixels are kept only when under the megapixel limit. */\n resident: boolean;\n workingCopy: RgbaBuffer;\n}\n\nexport interface RenderRequest {\n log: EditLog;\n /** `workingCopy` renders on the working copy in preview mode; `full` renders the resident source in truth mode. */\n target: 'workingCopy' | 'full';\n upTo?: number;\n signal?: AbortSignal;\n}\n\nexport interface ExportRequest {\n log: EditLog;\n output: OutputOptions;\n upTo?: number;\n embedEditLog?: boolean;\n}\n\nexport interface ExportResult {\n /** Backed by a plain `ArrayBuffer`, so it is a `BlobPart`. */\n bytes: Uint8Array<ArrayBuffer>;\n mimeType: OutputOptions['format'];\n width: number;\n height: number;\n hash: string;\n}\n\nexport interface RendererCoreOptions {\n plugins: readonly AnyPlugin[];\n /** Full-resolution pixels above this are not kept after loading. `RendererLoadOptions` overrides it per load. */\n maxClientMegapixels: number;\n /** Longest side of the preview working copy. */\n workingCopyMaxSide: number;\n /** Cached stage outputs kept for the preview pipeline. */\n cacheEntries?: number;\n}\n\n/** Per-load overrides of `RendererCoreOptions`. The session passes its `limits` here. */\nexport interface RendererLoadOptions {\n /** Full-resolution pixels above this are not kept after loading. Defaults to the renderer's option. */\n maxClientMegapixels?: number;\n}\n\nexport class RendererCore {\n readonly registry: Registry;\n private readonly options: RendererCoreOptions;\n private full: RgbaBuffer | null = null;\n private workingCopy: RgbaBuffer | null = null;\n private descriptor: SourceDescriptor | null = null;\n private readonly cache = new Map<string, RgbaBuffer>();\n\n constructor(\n readonly wasm: SealpixelWasm,\n options: RendererCoreOptions,\n ) {\n this.options = options;\n this.registry = createRegistry(options.plugins);\n }\n\n putAsset(id: string, bytes: Uint8Array): void {\n this.wasm.assetPut(id, bytes);\n }\n\n hasAsset(id: string): boolean {\n return this.wasm.assetHas(id);\n }\n\n info(): { coreVersion: string; plugins: Record<string, number> } {\n return { coreVersion: this.wasm.version(), plugins: this.registry.pluginVersions() };\n }\n\n /** Decodes `bytes`, derives the descriptor and working copy, and drops the full image when too large. */\n load(bytes: Uint8Array, id: string, loadOptions: RendererLoadOptions = {}): LoadedSource {\n const decoded = this.wasm.decode(bytes);\n const hash = this.wasm.sha256Hex(bytes);\n const descriptor: SourceDescriptor = {\n id,\n width: decoded.width,\n height: decoded.height,\n hash,\n mimeType: decoded.mimeType,\n };\n const megapixels = (decoded.width * decoded.height) / 1e6;\n const maxClientMegapixels = loadOptions.maxClientMegapixels ?? this.options.maxClientMegapixels;\n const resident = megapixels <= maxClientMegapixels;\n const workingCopy = this.wasm.resizeWorkingCopy(decoded, this.options.workingCopyMaxSide);\n this.full = resident ? decoded : null;\n this.workingCopy = workingCopy;\n this.descriptor = descriptor;\n this.cache.clear();\n return {\n descriptor,\n resident,\n workingCopy: { ...workingCopy, data: new Uint8Array(workingCopy.data) },\n };\n }\n\n /** Decodes an encoded working copy (for example one the host built elsewhere) and uses it as the preview source. */\n loadWorkingCopyEncoded(bytes: Uint8Array, descriptor: SourceDescriptor): LoadedSource {\n return this.loadWorkingCopy(this.wasm.decode(bytes), descriptor);\n }\n\n /** Accepts pixels decoded elsewhere, for example by a native decoder. Never resident. */\n loadWorkingCopy(workingCopy: RgbaBuffer, descriptor: SourceDescriptor): LoadedSource {\n this.full = null;\n this.workingCopy = workingCopy;\n this.descriptor = descriptor;\n this.cache.clear();\n return {\n descriptor,\n resident: false,\n workingCopy: { ...workingCopy, data: new Uint8Array(workingCopy.data) },\n };\n }\n\n hasSource(): boolean {\n return this.descriptor !== null;\n }\n\n isResident(): boolean {\n return this.full !== null;\n }\n\n unload(): void {\n this.full = null;\n this.workingCopy = null;\n this.descriptor = null;\n this.cache.clear();\n }\n\n /** Renders the log. Preview renders are split per stage and cached by prefix. */\n async render(req: RenderRequest): Promise<RgbaBuffer> {\n const { descriptor } = this.require();\n const image = req.target === 'full' ? this.full : this.workingCopy;\n if (!image) {\n throw new SealpixelError(\n 'SOURCE_MISMATCH',\n req.target === 'full'\n ? 'full-resolution pixels are not resident; render the original outside the browser'\n : 'no source loaded',\n );\n }\n const mode = req.target === 'full' ? 'truth' : 'preview';\n const doc = compile(req.log, this.registry, req.upTo);\n const logical = { width: descriptor.width, height: descriptor.height };\n const ctx: PlanContext = {\n logical,\n actual: { width: image.width, height: image.height },\n scale: image.width / logical.width,\n mode,\n };\n const stages = toPipeline(doc, this.registry, ctx);\n return this.runStages(stages, image, logical, mode, req.signal, mode === 'preview');\n }\n\n async export(req: ExportRequest): Promise<ExportResult> {\n const rendered = await this.render({\n log: req.log,\n target: 'full',\n ...(req.upTo === undefined ? {} : { upTo: req.upTo }),\n });\n const coreOutput = toCoreOutput(req.output);\n if (req.embedEditLog) {\n coreOutput['embed'] = canonicalJson({ log: req.log, index: req.upTo ?? req.log.ops.length });\n }\n const bytes = this.wasm.encode(rendered, JSON.stringify(coreOutput));\n return {\n bytes,\n mimeType: req.output.format,\n width: rendered.width,\n height: rendered.height,\n hash: this.wasm.sha256Hex(bytes),\n };\n }\n\n geometry(log: EditLog, target: 'workingCopy' | 'full', upTo?: number): Geometry {\n const { descriptor } = this.require();\n const image = (target === 'full' ? this.full : this.workingCopy) ?? this.workingCopy;\n if (!image) throw new SealpixelError('SOURCE_MISMATCH', 'no source loaded');\n const logical = { width: descriptor.width, height: descriptor.height };\n const doc = compile(log, this.registry, upTo);\n const stages = toPipeline(doc, this.registry, {\n logical,\n actual: { width: image.width, height: image.height },\n scale: image.width / logical.width,\n mode: target === 'full' ? 'truth' : 'preview',\n });\n const core = stages.filter((s) => s.kind === 'core');\n const plan: RenderPlan = {\n version: PLAN_VERSION,\n source: logical,\n bufferScale: image.width / logical.width,\n stages: toCoreStages(core),\n };\n return JSON.parse(\n this.wasm.resolveGeometry(JSON.stringify(plan), image.width, image.height),\n ) as Geometry;\n }\n\n private require(): { descriptor: SourceDescriptor } {\n if (!this.descriptor) throw new SealpixelError('SOURCE_MISMATCH', 'no source loaded');\n return { descriptor: this.descriptor };\n }\n\n private async runStages(\n stages: PipelineStage[],\n image: RgbaBuffer,\n logical: { width: number; height: number },\n mode: 'truth' | 'preview',\n signal: AbortSignal | undefined,\n useCache: boolean,\n ): Promise<RgbaBuffer> {\n let current = image;\n let currentLogical = logical;\n let prefix = `${image.width}x${image.height}`;\n for (const stage of stages) {\n if (signal?.aborted) throw new SealpixelError('ABORTED', 'render aborted');\n prefix += `|${canonicalJson({ n: stage.name, p: stage.params })}`;\n const cached = useCache ? this.cache.get(prefix) : undefined;\n if (cached) {\n current = cached;\n currentLogical = this.logicalAfter(stage, currentLogical, current, image, logical);\n continue;\n }\n if (stage.kind === 'core') {\n const plan: RenderPlan = {\n version: PLAN_VERSION,\n source: currentLogical,\n bufferScale: current.width / currentLogical.width,\n stages: toCoreStages([stage]),\n };\n const planJson = JSON.stringify(plan);\n const geometry = JSON.parse(\n this.wasm.resolveGeometry(planJson, current.width, current.height),\n ) as Geometry;\n current = this.wasm.renderRgba(current, planJson);\n currentLogical = geometry.logicalOut;\n } else {\n const kctx: KernelContext = {\n logical: currentLogical,\n actual: { width: current.width, height: current.height },\n scale: current.width / currentLogical.width,\n mode,\n asset: (id) => {\n throw new SealpixelError(\n 'MISSING_ASSET',\n `asset \"${id}\" is not available to JS kernels yet`,\n { assetId: id },\n );\n },\n signal: signal ?? new AbortController().signal,\n };\n const out = await runExternalKernel(stage.plugin, current, stage.params, kctx);\n if (out.width !== current.width || out.height !== current.height) {\n currentLogical = {\n width: Math.round(currentLogical.width * (out.width / current.width)),\n height: Math.round(currentLogical.height * (out.height / current.height)),\n };\n }\n current = out;\n }\n if (useCache) this.remember(prefix, current);\n }\n return current;\n }\n\n /** Recomputes the logical size after a cached stage by asking the core for its geometry. */\n private logicalAfter(\n stage: PipelineStage,\n logicalIn: { width: number; height: number },\n out: RgbaBuffer,\n _image: RgbaBuffer,\n _sourceLogical: { width: number; height: number },\n ): { width: number; height: number } {\n if (stage.kind !== 'core') {\n return {\n width: Math.round(logicalIn.width * (out.width / out.width)),\n height: logicalIn.height,\n };\n }\n // The cached buffer already has the output size; the logical size is the\n // geometry of this single stage on a buffer with the input's logical size.\n const plan: RenderPlan = {\n version: PLAN_VERSION,\n source: logicalIn,\n bufferScale: 1,\n stages: toCoreStages([stage]),\n };\n const g = JSON.parse(\n this.wasm.resolveGeometry(JSON.stringify(plan), logicalIn.width, logicalIn.height),\n ) as Geometry;\n return g.logicalOut;\n }\n\n private remember(key: string, value: RgbaBuffer): void {\n const limit = this.options.cacheEntries ?? 6;\n if (this.cache.has(key)) this.cache.delete(key);\n this.cache.set(key, value);\n while (this.cache.size > limit) {\n const oldest = this.cache.keys().next().value;\n if (oldest === undefined) break;\n this.cache.delete(oldest);\n }\n }\n\n /** For tests: number of cached stage outputs. */\n cacheSize(): number {\n return this.cache.size;\n }\n}\n"]}
@@ -12,13 +12,13 @@ export interface Renderer {
12
12
  plugins: Record<string, number>;
13
13
  }>;
14
14
  load(bytes: Uint8Array, id: string, options?: RendererLoadOptions): Promise<LoadedSource>;
15
- loadProxy(proxy: RgbaBuffer, descriptor: SourceDescriptor): Promise<LoadedSource>;
16
- loadProxyEncoded(bytes: Uint8Array, descriptor: SourceDescriptor): Promise<LoadedSource>;
15
+ loadWorkingCopy(workingCopy: RgbaBuffer, descriptor: SourceDescriptor): Promise<LoadedSource>;
16
+ loadWorkingCopyEncoded(bytes: Uint8Array, descriptor: SourceDescriptor): Promise<LoadedSource>;
17
17
  render(req: RenderRequest): Promise<RgbaBuffer>;
18
18
  export(req: ExportRequest): Promise<ExportResult>;
19
19
  geometry(req: {
20
20
  log: RenderRequest['log'];
21
- target: 'proxy' | 'full';
21
+ target: 'workingCopy' | 'full';
22
22
  upTo?: number;
23
23
  }): Promise<Geometry>;
24
24
  unload(): Promise<void>;
@@ -26,4 +26,3 @@ export interface Renderer {
26
26
  putAsset(id: string, bytes: Uint8Array): Promise<void>;
27
27
  dispose(): void;
28
28
  }
29
- //# sourceMappingURL=renderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.js","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"renderer.js","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"","sourcesContent":["import type { RgbaBuffer } from '@sealpixel/wasm';\nimport type { Geometry } from './plan.js';\nimport type {\n ExportRequest,\n ExportResult,\n LoadedSource,\n RendererLoadOptions,\n RenderRequest,\n} from './renderer-core.js';\nimport type { SourceDescriptor } from './types.js';\n\n/**\n * What the session talks to. Implemented by `InlineRenderer` (same thread)\n * and `WorkerRenderer` (message protocol to a worker running `startSealpixelWorker`).\n */\nexport interface Renderer {\n init(): Promise<{ coreVersion: string; plugins: Record<string, number> }>;\n load(bytes: Uint8Array, id: string, options?: RendererLoadOptions): Promise<LoadedSource>;\n loadWorkingCopy(workingCopy: RgbaBuffer, descriptor: SourceDescriptor): Promise<LoadedSource>;\n loadWorkingCopyEncoded(bytes: Uint8Array, descriptor: SourceDescriptor): Promise<LoadedSource>;\n render(req: RenderRequest): Promise<RgbaBuffer>;\n export(req: ExportRequest): Promise<ExportResult>;\n geometry(req: {\n log: RenderRequest['log'];\n target: 'workingCopy' | 'full';\n upTo?: number;\n }): Promise<Geometry>;\n unload(): Promise<void>;\n /** Stores a verified asset for kernels that reference it by id. */\n putAsset(id: string, bytes: Uint8Array): Promise<void>;\n dispose(): void;\n}\n"]}
package/dist/session.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Headless editor session. Owns the edit log (as `History`), the derived
3
3
  * document, and a renderer. Every state change schedules a debounced preview
4
- * render on the proxy; stale results are discarded by version.
4
+ * render on the working copy; stale results are discarded by version.
5
5
  */
6
6
  import type { RgbaBuffer } from '@sealpixel/wasm';
7
7
  import { type AssetResolver } from './assets.js';
@@ -27,8 +27,10 @@ export interface SessionOptions {
27
27
  renderer?: Renderer;
28
28
  /**
29
29
  * How much of the original stays in the browser. Default 16 megapixels and
30
- * 20e6 bytes. An image above `maxClientMegapixels` is not resident: the
31
- * preview works on a proxy, and `export` needs a server. An image above
30
+ * 50e6 bytes, enough for a camera JPEG of 60 megapixels. An image above
31
+ * `maxClientMegapixels` is not resident: the preview works on a working
32
+ * copy, and `export` fails with `NOT_RESIDENT`: the host renders the
33
+ * original elsewhere. An image above
32
34
  * `maxClientBytes` does not load at all (`TOO_LARGE`). The megapixel limit
33
35
  * reaches the renderer with every load, so a shared worker follows the
34
36
  * session that loads into it.
@@ -42,35 +44,12 @@ export interface SessionOptions {
42
44
  enabled?: boolean;
43
45
  };
44
46
  /**
45
- * Server rendering: `endpoint` accepts the `@sealpixel/server` contract. Used
46
- * by `requestServerRender`, by `download({ via: 'server' })`, and by the
47
- * `server` proxy strategy for images above the client limits.
47
+ * The preview image. The session always decodes the original in WebAssembly
48
+ * and downscales it itself. `maxSide` is the longest side for the default
49
+ * renderer. Default 2048. A `renderer` passed in uses its own setting.
48
50
  */
49
- server?: {
50
- endpoint: string;
51
- fetch?: typeof fetch;
52
- headers?: Record<string, string>;
53
- /**
54
- * Send the original to the endpoint's upload route instead of inside the
55
- * request once it is larger than this many bytes. Default 4_000_000.
56
- *
57
- * A request body has a ceiling that has nothing to do with the image: a
58
- * Lambda Function URL refuses anything over 6 MB, and an inline source
59
- * travels base64-encoded, a third larger again. Above that the original has
60
- * to reach the store another way.
61
- *
62
- * An endpoint without the route answers 404 and the original goes inline
63
- * after all, which is what happened before this existed. Set
64
- * `Number.POSITIVE_INFINITY` to never upload, or 0 to always.
65
- */
66
- uploadOver?: number;
67
- /** Defaults to `endpoint` with a trailing `/render` swapped for `/upload`, or `/upload` appended. */
68
- uploadEndpoint?: string;
69
- };
70
- /** How to obtain the preview for images above the client limits. Default `auto`. */
71
- proxy?: {
51
+ workingCopy?: {
72
52
  maxSide?: number;
73
- strategy?: 'auto' | 'wasm' | 'server';
74
53
  };
75
54
  /** Fonts and images referenced by the log. Defaults to the plugins' declarations with relative urls. */
76
55
  assets?: AssetResolver;
@@ -114,16 +93,14 @@ export interface ExportOptions {
114
93
  }
115
94
  export interface DownloadOptions extends Partial<ExportOptions> {
116
95
  filename?: string;
117
- /** `auto` renders locally when the image is resident, otherwise on the server. */
118
- via?: 'auto' | 'local' | 'server';
119
96
  }
120
97
  export interface EditorSession {
121
98
  readonly registry: Registry;
122
99
  /**
123
100
  * Loads an image, optionally resuming a saved state. On failure the session
124
- * stays on the previous image: the state, the renderer and the bytes for
125
- * server renders keep describing it. When a newer `load` starts before this
126
- * one finishes, this one rejects with `ABORTED` and the newer one wins.
101
+ * stays on the previous image: the state and the renderer keep describing
102
+ * it. When a newer `load` starts before this one finishes, this one rejects
103
+ * with `ABORTED` and the newer one wins.
127
104
  */
128
105
  load(source: LoadSource, options?: LoadOptions): Promise<SourceDescriptor>;
129
106
  dispatch(op: Operation): void;
@@ -155,7 +132,7 @@ export interface EditorSession {
155
132
  */
156
133
  setPreviewTransform(transform: ((log: EditLog) => EditLog) | null): void;
157
134
  /**
158
- * Renders a proxy-sized image from the current log, transformed, and returns
135
+ * Renders a working-copy-sized image from the current log, transformed, and returns
159
136
  * it without touching the stage, the state or the history. Tools use it to
160
137
  * show what an edit the user has not made yet would look like: the filter
161
138
  * tool renders its thumbnails from the log with the filter removed, so a
@@ -173,47 +150,19 @@ export interface EditorSession {
173
150
  id?: string;
174
151
  url?: string;
175
152
  }): Promise<AssetDeclaration>;
153
+ /**
154
+ * Renders the full resolution in the browser. Throws `NOT_RESIDENT` when the
155
+ * image is above `maxClientMegapixels`: the host then renders the original
156
+ * elsewhere, from the log that `getEditLog()` returns.
157
+ */
176
158
  export(options: ExportOptions): Promise<ExportResult>;
159
+ /** Exports like `export` and hands the file to `saveFile`. */
177
160
  download(options?: DownloadOptions): Promise<{
178
161
  filename: string;
179
- result: ExportResult | ServerRenderResult;
162
+ result: ExportResult;
180
163
  }>;
181
- /**
182
- * Renders on the server from the original bytes (inline) or a host-provided
183
- * source reference. With `destination: 's3'` the server stores the object and
184
- * returns its key and presigned url; otherwise the bytes come back.
185
- */
186
- requestServerRender(options: ServerRenderOptions): Promise<ServerRenderResult>;
187
164
  dispose(): void;
188
165
  }
189
- export interface ServerRenderOptions extends ExportOptions {
190
- /** Defaults to the loaded bytes sent inline. Hosts that uploaded the original pass its reference. */
191
- source?: {
192
- kind: 's3';
193
- bucket?: string;
194
- key: string;
195
- } | {
196
- kind: 'url';
197
- url: string;
198
- };
199
- destination?: 's3' | 'response';
200
- endpoint?: string;
201
- }
202
- export interface ServerRenderResult {
203
- /** Present for `destination: 'response'`. */
204
- bytes?: Uint8Array;
205
- /** Present for `destination: 's3'`. */
206
- url?: string | null;
207
- objectKey?: string;
208
- bucket?: string;
209
- hash: string;
210
- width: number;
211
- height: number;
212
- mimeType: OutputOptions['format'];
213
- cached: boolean;
214
- jobKey: string;
215
- }
216
166
  export declare function createEditorSession(options: SessionOptions): EditorSession;
217
167
  /** Default `saveFile`: an `<a download>` click, with the share sheet as a fallback on iOS Safari. */
218
168
  export declare function browserSaveFile(bytes: Uint8Array, filename: string, mimeType: string): Promise<void>;
219
- //# sourceMappingURL=session.d.ts.map