@tsdoctor/seo 0.2.0 → 0.2.1
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/index.d.ts +24 -24
- package/package.json +5 -5
package/index.d.ts
CHANGED
|
@@ -100,7 +100,7 @@ interface AttributionFacts {
|
|
|
100
100
|
*
|
|
101
101
|
* @public
|
|
102
102
|
*/
|
|
103
|
-
declare function attributionFacts(manifest: PackageManifest): AttributionFacts;
|
|
103
|
+
export declare function attributionFacts(manifest: PackageManifest): AttributionFacts;
|
|
104
104
|
//#endregion
|
|
105
105
|
//#region src/Canonical.d.ts
|
|
106
106
|
/**
|
|
@@ -122,7 +122,7 @@ declare function attributionFacts(manifest: PackageManifest): AttributionFacts;
|
|
|
122
122
|
*
|
|
123
123
|
* @public
|
|
124
124
|
*/
|
|
125
|
-
declare function imageMimeType(type: string | undefined): string | undefined;
|
|
125
|
+
export declare function imageMimeType(type: string | undefined): string | undefined;
|
|
126
126
|
/**
|
|
127
127
|
* Turn a configured URL into an absolute one.
|
|
128
128
|
*
|
|
@@ -133,7 +133,7 @@ declare function imageMimeType(type: string | undefined): string | undefined;
|
|
|
133
133
|
*
|
|
134
134
|
* @public
|
|
135
135
|
*/
|
|
136
|
-
declare function resolveUrl(siteUrl: string, url: string): string | undefined;
|
|
136
|
+
export declare function resolveUrl(siteUrl: string, url: string): string | undefined;
|
|
137
137
|
/**
|
|
138
138
|
* Derive the site URL prefix from the framework's own config.
|
|
139
139
|
*
|
|
@@ -162,7 +162,7 @@ declare function resolveUrl(siteUrl: string, url: string): string | undefined;
|
|
|
162
162
|
*
|
|
163
163
|
* @public
|
|
164
164
|
*/
|
|
165
|
-
declare function deriveSiteUrl(siteOrigin: string | undefined, base: string | undefined): string;
|
|
165
|
+
export declare function deriveSiteUrl(siteOrigin: string | undefined, base: string | undefined): string;
|
|
166
166
|
/**
|
|
167
167
|
* The canonical URL for a page.
|
|
168
168
|
*
|
|
@@ -174,7 +174,7 @@ declare function deriveSiteUrl(siteOrigin: string | undefined, base: string | un
|
|
|
174
174
|
*
|
|
175
175
|
* @public
|
|
176
176
|
*/
|
|
177
|
-
declare function canonicalUrl(siteUrl: string, pageRoute: string): string;
|
|
177
|
+
export declare function canonicalUrl(siteUrl: string, pageRoute: string): string;
|
|
178
178
|
//#endregion
|
|
179
179
|
//#region src/HeadTag.d.ts
|
|
180
180
|
/**
|
|
@@ -223,15 +223,15 @@ interface HeadTag {
|
|
|
223
223
|
*
|
|
224
224
|
* @public
|
|
225
225
|
*/
|
|
226
|
-
declare function escapeScriptBody(json: string): string;
|
|
226
|
+
export declare function escapeScriptBody(json: string): string;
|
|
227
227
|
/** An Open Graph style `<meta property=… content=…>`. @public */
|
|
228
|
-
declare function meta(property: string, content: string): HeadTag;
|
|
228
|
+
export declare function meta(property: string, content: string): HeadTag;
|
|
229
229
|
/** A Twitter/standard style `<meta name=… content=…>`. @public */
|
|
230
|
-
declare function metaNamed(name: string, content: string): HeadTag;
|
|
230
|
+
export declare function metaNamed(name: string, content: string): HeadTag;
|
|
231
231
|
/** A `<link rel=… href=…>`. @public */
|
|
232
|
-
declare function link(rel: string, href: string): HeadTag;
|
|
232
|
+
export declare function link(rel: string, href: string): HeadTag;
|
|
233
233
|
/** A `<script type="application/ld+json">` carrying an escaped body. @public */
|
|
234
|
-
declare function jsonLd(json: string): HeadTag;
|
|
234
|
+
export declare function jsonLd(json: string): HeadTag;
|
|
235
235
|
//#endregion
|
|
236
236
|
//#region src/OpenGraph.d.ts
|
|
237
237
|
/**
|
|
@@ -239,7 +239,7 @@ declare function jsonLd(json: string): HeadTag;
|
|
|
239
239
|
*
|
|
240
240
|
* @public
|
|
241
241
|
*/
|
|
242
|
-
declare const OpenGraphImageMetadata: Schema.Struct<{
|
|
242
|
+
export declare const OpenGraphImageMetadata: Schema.Struct<{
|
|
243
243
|
/** Absolute URL of the image. */
|
|
244
244
|
readonly url: Schema.String;
|
|
245
245
|
/** HTTPS URL of the image (for secure contexts). */
|
|
@@ -254,13 +254,13 @@ declare const OpenGraphImageMetadata: Schema.Struct<{
|
|
|
254
254
|
readonly alt: Schema.optional<Schema.String>;
|
|
255
255
|
}>;
|
|
256
256
|
/** @public */
|
|
257
|
-
type OpenGraphImageMetadata = typeof OpenGraphImageMetadata.Type;
|
|
257
|
+
export type OpenGraphImageMetadata = typeof OpenGraphImageMetadata.Type;
|
|
258
258
|
/**
|
|
259
259
|
* Open Graph image: either a plain URL string or structured `OpenGraphImageMetadata`.
|
|
260
260
|
*
|
|
261
261
|
* @public
|
|
262
262
|
*/
|
|
263
|
-
declare const OpenGraphImageConfig: Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
263
|
+
export declare const OpenGraphImageConfig: Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
264
264
|
/** Absolute URL of the image. */
|
|
265
265
|
readonly url: Schema.String;
|
|
266
266
|
/** HTTPS URL of the image (for secure contexts). */
|
|
@@ -275,13 +275,13 @@ declare const OpenGraphImageConfig: Schema.Union<readonly [Schema.String, Schema
|
|
|
275
275
|
readonly alt: Schema.optional<Schema.String>;
|
|
276
276
|
}>]>;
|
|
277
277
|
/** @public */
|
|
278
|
-
type OpenGraphImageConfig = typeof OpenGraphImageConfig.Type;
|
|
278
|
+
export type OpenGraphImageConfig = typeof OpenGraphImageConfig.Type;
|
|
279
279
|
/**
|
|
280
280
|
* Resolved Open Graph metadata for one documentation page.
|
|
281
281
|
*
|
|
282
282
|
* @public
|
|
283
283
|
*/
|
|
284
|
-
declare const OpenGraphMetadata: Schema.Struct<{
|
|
284
|
+
export declare const OpenGraphMetadata: Schema.Struct<{
|
|
285
285
|
/** Canonical site base URL. */
|
|
286
286
|
readonly siteUrl: Schema.String;
|
|
287
287
|
/** Page route path (e.g. `/api/classes/myclass`). */
|
|
@@ -319,13 +319,13 @@ declare const OpenGraphMetadata: Schema.Struct<{
|
|
|
319
319
|
readonly ogType: Schema.String;
|
|
320
320
|
}>;
|
|
321
321
|
/** @public */
|
|
322
|
-
type OpenGraphMetadata = typeof OpenGraphMetadata.Type;
|
|
322
|
+
export type OpenGraphMetadata = typeof OpenGraphMetadata.Type;
|
|
323
323
|
/**
|
|
324
324
|
* Assemble the complete Open Graph metadata for one documentation page.
|
|
325
325
|
*
|
|
326
326
|
* @public
|
|
327
327
|
*/
|
|
328
|
-
declare function createPageMetadata(options: {
|
|
328
|
+
export declare function createPageMetadata(options: {
|
|
329
329
|
siteUrl: string;
|
|
330
330
|
pageRoute: string;
|
|
331
331
|
title: string;
|
|
@@ -347,7 +347,7 @@ declare function createPageMetadata(options: {
|
|
|
347
347
|
*
|
|
348
348
|
* @public
|
|
349
349
|
*/
|
|
350
|
-
declare function openGraphTags(metadata: OpenGraphMetadata): ReadonlyArray<HeadTag>;
|
|
350
|
+
export declare function openGraphTags(metadata: OpenGraphMetadata): ReadonlyArray<HeadTag>;
|
|
351
351
|
/**
|
|
352
352
|
* Twitter card tags derived from the same metadata as the Open Graph block.
|
|
353
353
|
*
|
|
@@ -362,7 +362,7 @@ declare function openGraphTags(metadata: OpenGraphMetadata): ReadonlyArray<HeadT
|
|
|
362
362
|
*
|
|
363
363
|
* @public
|
|
364
364
|
*/
|
|
365
|
-
declare function twitterTags(metadata: OpenGraphMetadata, site?: string): ReadonlyArray<HeadTag>;
|
|
365
|
+
export declare function twitterTags(metadata: OpenGraphMetadata, site?: string): ReadonlyArray<HeadTag>;
|
|
366
366
|
//#endregion
|
|
367
367
|
//#region src/Seo.d.ts
|
|
368
368
|
/**
|
|
@@ -407,7 +407,7 @@ interface SeoPageInput {
|
|
|
407
407
|
*
|
|
408
408
|
* @public
|
|
409
409
|
*/
|
|
410
|
-
declare function headTags(input: SeoPageInput): ReadonlyArray<HeadTag>;
|
|
410
|
+
export declare function headTags(input: SeoPageInput): ReadonlyArray<HeadTag>;
|
|
411
411
|
//#endregion
|
|
412
412
|
//#region src/StructuredData.d.ts
|
|
413
413
|
/**
|
|
@@ -504,7 +504,7 @@ interface PackageContext {
|
|
|
504
504
|
*
|
|
505
505
|
* @public
|
|
506
506
|
*/
|
|
507
|
-
declare function packageContext(input: PackageNodeInput): PackageContext;
|
|
507
|
+
export declare function packageContext(input: PackageNodeInput): PackageContext;
|
|
508
508
|
/**
|
|
509
509
|
* Derive the schema.org graph for one documentation page.
|
|
510
510
|
*
|
|
@@ -526,7 +526,7 @@ declare function packageContext(input: PackageNodeInput): PackageContext;
|
|
|
526
526
|
*
|
|
527
527
|
* @public
|
|
528
528
|
*/
|
|
529
|
-
declare function derive(pkg: PackageContext, page: PageNodeInput): Result.Result<JsonLdDocument, StructuredDataError>;
|
|
529
|
+
export declare function derive(pkg: PackageContext, page: PageNodeInput): Result.Result<JsonLdDocument, StructuredDataError>;
|
|
530
530
|
/**
|
|
531
531
|
* {@link derive}, serialized to the text an adapter embeds in a `<script>`.
|
|
532
532
|
*
|
|
@@ -541,7 +541,7 @@ declare function derive(pkg: PackageContext, page: PageNodeInput): Result.Result
|
|
|
541
541
|
*
|
|
542
542
|
* @public
|
|
543
543
|
*/
|
|
544
|
-
declare function deriveScriptBody(pkg: PackageContext, page: PageNodeInput): Result.Result<string, StructuredDataError>;
|
|
544
|
+
export declare function deriveScriptBody(pkg: PackageContext, page: PageNodeInput): Result.Result<string, StructuredDataError>;
|
|
545
545
|
//#endregion
|
|
546
|
-
export {
|
|
546
|
+
export type { AttributionFacts, HeadTag, PackageContext, PackageNodeInput, PageNodeInput, SeoPageInput, StructuredDataError };
|
|
547
547
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsdoctor/seo",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Framework-neutral head metadata for static TypeScript API documentation: schema.org JSON-LD, Open Graph and Twitter card vocabulary, canonical URLs, and package attribution derived from an api.json model plus its manifest.",
|
|
6
6
|
"keywords": [
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@effected/package-json": "^0.
|
|
41
|
-
"@effected/schema-org": "^0.
|
|
42
|
-
"@effected/spdx": "^0.
|
|
43
|
-
"effect": "4.0.0-rc.
|
|
40
|
+
"@effected/package-json": "^0.14.0",
|
|
41
|
+
"@effected/schema-org": "^0.2.0",
|
|
42
|
+
"@effected/spdx": "^0.6.0",
|
|
43
|
+
"effect": "4.0.0-rc.112"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=24.11.0"
|