[ci] format
This commit is contained in:
parent
b12c8471f4
commit
821918bc0c
4 changed files with 15 additions and 9 deletions
|
@ -1,7 +1,6 @@
|
|||
import type { SSRResult } from '../../../@types/astro';
|
||||
import type { RenderInstruction } from './instruction.js';
|
||||
|
||||
import { isRenderInstruction } from './instruction.js';
|
||||
import { HTMLBytes, HTMLString, markHTMLString } from '../escape.js';
|
||||
import {
|
||||
determineIfNeedsHydrationScript,
|
||||
|
@ -10,6 +9,7 @@ import {
|
|||
type PrescriptType,
|
||||
} from '../scripts.js';
|
||||
import { renderAllHeadContent } from './head.js';
|
||||
import { isRenderInstruction } from './instruction.js';
|
||||
import { isSlotString, type SlotString } from './slot.js';
|
||||
|
||||
/**
|
||||
|
@ -65,8 +65,8 @@ function stringifyChunk(
|
|||
let prescriptType: PrescriptType = needsHydrationScript
|
||||
? 'both'
|
||||
: needsDirectiveScript
|
||||
? 'directive'
|
||||
: null;
|
||||
? 'directive'
|
||||
: null;
|
||||
if (prescriptType) {
|
||||
let prescripts = getPrescripts(result, prescriptType, hydration.directive);
|
||||
return markHTMLString(prescripts);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { SSRResult } from '../../../@types/astro';
|
||||
|
||||
import { markHTMLString } from '../escape.js';
|
||||
import { createRenderInstruction } from './instruction.js';
|
||||
import type { MaybeRenderHeadInstruction, RenderHeadInstruction } from './instruction.js';
|
||||
import { createRenderInstruction } from './instruction.js';
|
||||
import { renderElement } from './util.js';
|
||||
|
||||
// Filter out duplicate elements in our set
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
export type { AstroComponentFactory, AstroComponentInstance } from './astro/index';
|
||||
export type { RenderInstruction } from './instruction';
|
||||
export { createHeadAndContent, renderTemplate, renderToString } from './astro/index.js';
|
||||
export { Fragment, Renderer, chunkToByteArray, chunkToString } from './common.js';
|
||||
export { renderComponent, renderComponentToString } from './component.js';
|
||||
export { renderHTMLElement } from './dom.js';
|
||||
export { maybeRenderHead, renderHead } from './head.js';
|
||||
export type { RenderInstruction } from './instruction';
|
||||
export { renderPage } from './page.js';
|
||||
export { renderSlot, renderSlotToString, type ComponentSlots } from './slot.js';
|
||||
export { renderScriptElement, renderUniqueStylesheet } from './tags.js';
|
||||
|
|
|
@ -20,13 +20,19 @@ export type RenderInstruction =
|
|||
| RenderHeadInstruction
|
||||
| MaybeRenderHeadInstruction;
|
||||
|
||||
export function createRenderInstruction(instruction: RenderDirectiveInstruction): RenderDirectiveInstruction;
|
||||
export function createRenderInstruction(
|
||||
instruction: RenderDirectiveInstruction
|
||||
): RenderDirectiveInstruction;
|
||||
export function createRenderInstruction(instruction: RenderHeadInstruction): RenderHeadInstruction;
|
||||
export function createRenderInstruction(instruction: MaybeRenderHeadInstruction): MaybeRenderHeadInstruction;
|
||||
export function createRenderInstruction(
|
||||
instruction: MaybeRenderHeadInstruction
|
||||
): MaybeRenderHeadInstruction;
|
||||
export function createRenderInstruction(instruction: { type: string }): RenderInstruction {
|
||||
return Object.defineProperty(instruction as RenderInstruction, RenderInstructionSymbol, { value: true });
|
||||
return Object.defineProperty(instruction as RenderInstruction, RenderInstructionSymbol, {
|
||||
value: true,
|
||||
});
|
||||
}
|
||||
|
||||
export function isRenderInstruction(chunk: any): chunk is RenderInstruction {
|
||||
return chunk && typeof chunk === 'object' && chunk[RenderInstructionSymbol];
|
||||
return chunk && typeof chunk === 'object' && chunk[RenderInstructionSymbol];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue