UNPKG

2.76 kBTypeScriptView Raw
1import { FunctionalComponent } from "preact";
2import { Ref } from "preact/hooks";
3export declare let warned: boolean;
4interface OpenGraphBase {
5 title?: string;
6 description?: string;
7 url?: string;
8 locale?: string;
9 altLocales?: string[];
10 siteName?: string;
11}
12declare type OpenGraph = OpenGraphArticle | OpenGraphProfile | OpenGraphBook | OpenGraphWebsite;
13interface OpenGraphProfile extends OpenGraphBase {
14 type?: "profile";
15 firstName?: string;
16 lastName?: string;
17 username?: string;
18 gender?: "male" | "female";
19}
20interface OpenGraphBook extends OpenGraphBase {
21 type?: "book";
22 authors?: string[];
23 isbn?: string;
24 releaseDate?: Date;
25 tags?: string[];
26}
27interface OpenGraphArticle extends OpenGraphBase {
28 type?: "article";
29 publishedTime?: Date;
30 modifiedTime?: Date;
31 expirationTime?: Date;
32 authors?: string[];
33 section?: string;
34 tags?: string[];
35}
36interface OpenGraphWebsite extends OpenGraphBase {
37 type?: "website";
38}
39interface SEO {
40 robots?: {
41 noindex?: boolean;
42 nofollow?: boolean;
43 };
44 title?: string;
45 description?: string;
46 images?: {
47 src: string;
48 alt?: string;
49 width?: number;
50 height?: number;
51 }[];
52 videos?: {
53 src: string;
54 width?: number;
55 height?: number;
56 }[];
57 audio?: {
58 src: string;
59 }[];
60 canonical?: string;
61 facebook?: {
62 appId?: string;
63 };
64 twitter?: {
65 site?: string;
66 handle?: string;
67 card?: "summary" | "summary_large_image" | "app" | "player";
68 };
69 openGraph?: OpenGraph;
70}
71export declare const __SeoContext: import("preact").Context<{
72 seo: Ref<SEO>;
73}>;
74export declare const Head: FunctionalComponent<any>;
75export declare const seo: {
76 robots: FunctionalComponent<{
77 children?: never;
78 } & {
79 noindex?: boolean;
80 nofollow?: boolean;
81 }>;
82 title: FunctionalComponent<{}>;
83 description: FunctionalComponent<{}>;
84 image: FunctionalComponent<{
85 children?: never;
86 } & {
87 src: string;
88 alt?: string;
89 width?: number;
90 height?: number;
91 }>;
92 video: FunctionalComponent<{
93 children?: never;
94 } & {
95 src: string;
96 width?: number;
97 height?: number;
98 }>;
99 audio: FunctionalComponent<{
100 children?: never;
101 } & {
102 src: string;
103 }>;
104 canonical: FunctionalComponent<{}>;
105 twitter: FunctionalComponent<{
106 site?: string;
107 handle?: string;
108 card?: "summary" | "summary_large_image" | "app" | "player";
109 }>;
110 facebook: FunctionalComponent<{
111 appId?: string;
112 }>;
113 openGraph: FunctionalComponent<OpenGraph>;
114};
115export {};