@shopify/react-html
Version:
A component to render your react app with no static HTML.
50 lines (49 loc) • 1.8 kB
TypeScript
/// <reference types="react" />
import { EffectKind } from '@shopify/react-effect';
export interface State {
title?: string;
metas: React.HTMLProps<HTMLMetaElement>[];
links: React.HTMLProps<HTMLLinkElement>[];
bodyAttributes: React.HTMLProps<HTMLBodyElement>;
htmlAttributes: React.HtmlHTMLAttributes<HTMLHtmlElement>;
}
interface Subscription {
(state: State): void;
}
export declare const EFFECT_ID: unique symbol;
export declare class HtmlManager {
effect: EffectKind;
private serializations;
private titles;
private metas;
private links;
private htmlAttributes;
private bodyAttributes;
private subscriptions;
readonly state: State;
reset({ includeSerializations }?: {
includeSerializations?: boolean | undefined;
}): void;
subscribe(subscription: Subscription): () => void;
addTitle(title: string): () => void;
addMeta(meta: React.HTMLProps<HTMLMetaElement>): () => void;
addLink(link: React.HTMLProps<HTMLLinkElement>): () => void;
addHtmlAttributes(attributes: React.HtmlHTMLAttributes<HTMLHtmlElement>): () => void;
addBodyAttributes(attributes: React.HTMLProps<HTMLBodyElement>): () => void;
setSerialization(id: string, data: unknown): void;
getSerialization<T>(id: string): T | undefined;
extract(): {
serializations: {
id: string;
data: unknown;
}[];
title?: string | undefined;
metas: import("react").HTMLProps<HTMLMetaElement>[];
links: import("react").HTMLProps<HTMLLinkElement>[];
bodyAttributes: import("react").HTMLProps<HTMLBodyElement>;
htmlAttributes: import("react").HtmlHTMLAttributes<HTMLHtmlElement>;
};
private addDescriptor;
private updateSubscriptions;
}
export {};