@mdsvex/render 1.0.0-next.3 → 1.0.0-next.4

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.
@@ -17,13 +17,13 @@ import { MapSink } from './mappings.js';
17
17
  import type { Mapping, MappingData } from './mappings.js';
18
18
  import type { MapTrace, SourceMapV3 } from './sourcemap.js';
19
19
  import { ComponentScope } from './scope.js';
20
- import type { ReplaceWarning } from './scope.js';
20
+ import type { ReplaceWarning, ShellTable } from './scope.js';
21
21
  export type { Mapping, CodeInformation, MappingData } from './mappings.js';
22
22
  export { MapSink } from './mappings.js';
23
- export { ComponentScope, component_imports } from './scope.js';
23
+ export { ComponentScope, component_imports, shell_key } from './scope.js';
24
24
  /** @internal a pass over the tree reads references as the renderer does */
25
25
  export { is_entity_name } from './entities.js';
26
- export type { ComponentImport, ComponentSource, DefaultImport, ReplaceWarning, } from './scope.js';
26
+ export type { ComponentImport, ComponentSource, DefaultImport, ReplaceWarning, Shell, ShellTable, } from './scope.js';
27
27
  /**
28
28
  * a fence the highlighter rendered, every string is markup svelte reads as
29
29
  * static text, braces in it are entities
@@ -236,6 +236,25 @@ export declare class DirectiveError extends Error {
236
236
  readonly column: number;
237
237
  constructor(c: Cursor, message: string);
238
238
  }
239
+ /** one use of a static directive with no shell yet */
240
+ export interface ShellRequest {
241
+ key: string;
242
+ /** the module of the component, emitted verbatim as an import specifier */
243
+ specifier: string;
244
+ /** its export name, the directive name */
245
+ name: string;
246
+ args: Record<string, string>;
247
+ label: boolean;
248
+ children: boolean;
249
+ /** the offset of the directive in the source */
250
+ start: number;
251
+ }
252
+ /**
253
+ * every static directive of the document in directives that shells has no
254
+ * shell for, one request per key in document order, empty when every use
255
+ * has one
256
+ */
257
+ export declare function shell_requests(buf: NodeBuffer, source: string, directives: ComponentScope, shells: ShellTable | undefined): ShellRequest[];
239
258
  /** generated offset of each out chunk, plus the end offset */
240
259
  declare function out_offsets(out: string[], scratch?: Uint32Array): Uint32Array;
241
260
  export declare const escape: typeof escape_html;
@@ -348,6 +367,11 @@ export declare class CursorHTMLRenderer {
348
367
  * contents div, the cached render of update ignores it
349
368
  */
350
369
  wrap_static?: boolean;
370
+ /**
371
+ * the shells of the static directives of the next renders, a static
372
+ * directive with none renders live, the cached render of update ignores it
373
+ */
374
+ shells?: ShellTable;
351
375
  /** the cached render met a footnote, so each update numbers them again */
352
376
  private noted;
353
377
  constructor(opts?: {