bun-plugin-stx 0.2.616 → 0.2.618

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/serve.d.ts CHANGED
@@ -239,6 +239,12 @@ export declare function bundleBrowserAsset(entrypoint: string): Promise<Response
239
239
  * "forever", since an unbounded wait is the failure the budget exists to stop.
240
240
  */
241
241
  export declare function resolveImageWarmupBindBudget(value: unknown): number;
242
+ /**
243
+ * `pageWarmup` from an option or config value. Anything unusable falls back to
244
+ * the default, and a path that is not a same-origin absolute path is dropped:
245
+ * the warm-up only ever asks this server for its own pages.
246
+ */
247
+ export declare function resolvePageWarmup(value: unknown): ResolvedPageWarmup;
242
248
  /**
243
249
  * Whether `promise` settles within `ms`. It is not cancelled either way: the
244
250
  * caller decides what to do with work that is still running.
@@ -285,6 +291,10 @@ export declare const SHARED_SCRIPT_PATH: unknown;
285
291
  export declare const MODULE_BUNDLE_PATH: unknown;
286
292
  /** Default for `imageWarmupBindBudgetMs`: well inside ts-cloud's 180s bind window. */
287
293
  export declare const DEFAULT_IMAGE_WARMUP_BIND_BUDGET_MS: unknown;
294
+ /** The header every page warm-up request carries. */
295
+ export declare const PAGE_WARMUP_HEADER: 'x-stx-warmup';
296
+ /** Default for `pageWarmup.budgetMs`: beside the image budget, inside ts-cloud's 180s bind window. */
297
+ export declare const DEFAULT_PAGE_WARMUP_BUDGET_MS: unknown;
288
298
  /**
289
299
  * Build the candidate regexes for a dynamic route file (stacksjs/stx#1927).
290
300
  *
@@ -347,6 +357,7 @@ export declare interface ServeOptions {
347
357
  imageWarmupGraceMs?: number
348
358
  imageWarmupBindBudgetMs?: number
349
359
  imageWarmup?: boolean | 'auto'
360
+ pageWarmup?: boolean | PageWarmupOptions
350
361
  publicDir?: string
351
362
  quiet?: boolean
352
363
  autoIncrementPort?: boolean | number
@@ -378,6 +389,17 @@ export declare interface ServeOptions {
378
389
  protectedPaths?: string[]
379
390
  }
380
391
  }
392
+ export declare interface PageWarmupOptions {
393
+ paths?: string[]
394
+ budgetMs?: number
395
+ concurrency?: number
396
+ }
397
+ export declare interface ResolvedPageWarmup {
398
+ enabled: boolean
399
+ paths: string[]
400
+ budgetMs: number
401
+ concurrency: number
402
+ }
381
403
  /**
382
404
  * The slice of Css this server calls, taken from the package's own types
383
405
  * rather than restated here.