Skip to content

Commit 9eeb727

Browse files
committed
Export more types
1 parent 0f5864b commit 9eeb727

File tree

5 files changed

+25
-4
lines changed

5 files changed

+25
-4
lines changed

deno.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/html.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
/**
2+
* HTML primitive values like strings and numbers.
3+
*
4+
* Note that we use [`String` objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
5+
* to store already properly escaped HTML.
6+
*/
17
// deno-lint-ignore ban-types
2-
type HtmlPrimitive = String | string | number | undefined | null;
8+
export type HtmlPrimitive = String | string | number | undefined | null;
39

410
/**
511
* An `Html` node – i.e. what can be used with `html` tagged templates.

src/feed.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
import { type Html, html, renderToString } from "./core/html.ts";
1010
import { htmlToResponse } from "./core/responses.ts";
1111

12-
interface AtomFeed {
12+
/**
13+
* An Atom feed with an array of entries.
14+
*/
15+
export interface AtomFeed {
1316
author?: AtomAuthor;
1417
entries: AtomEntry[];
1518
/** Link to the feed itself. */

src/images.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,16 @@ import {
1616
MagickFormat,
1717
} from "npm:@imagemagick/[email protected]";
1818

19+
export type ImageFormat = MagickFormat;
20+
21+
/**
22+
* Preset to transform an image to the specified format, using a transform function
23+
* which gets passed an [IMagickImage](https://github.com/dlemstra/magick-wasm/blob/82a4c4e45d5fda6c88becbaba8340df3f5d30c13/src/magick-image.ts#L81)
24+
* on which you can methods like `.resize(64, 64)`;
25+
*/
1926
export interface ImagePreset {
20-
format?: MagickFormat;
27+
/** defaults to WEBP */
28+
format?: ImageFormat;
2129
transform: (image: IMagickImage) => void;
2230
}
2331

src/markdown.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ const importLazy = (pkg: string) =>
1414
// from https://github.com/dworthen/js-yaml-front-matter/blob/master/src/index.js#L14
1515
const yamlFrontRe = /^(-{3}(?:\n|\r)([\w\W]+?)(?:\n|\r)-{3})?([\w\W]*)*/;
1616

17-
interface Md {
17+
/**
18+
* Return type containing the generated HTML and the YAML metadata.
19+
*/
20+
export interface Md {
1821
content: Html;
1922
meta: Record<string, string>;
2023
}

0 commit comments

Comments
 (0)