-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
49 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ export { visit as unistVisit } from "https://esm.sh/[email protected]"; | |
export { configureAll } from "./lib/directives.ts"; | ||
export { parseMarkdown } from "./lib/markdown.ts"; | ||
export { preactify } from "./lib/preactify.ts"; | ||
export { createElement, Fragment } from "preact"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
/// <reference no-default-lib="true" /> | ||
/// <reference lib="deno.ns" /> | ||
|
||
export { type Root as Mdast } from "https://esm.sh/v114/@types/[email protected]/index.d.ts"; | ||
export type { Root as Mdast } from "https://esm.sh/v114/@types/[email protected]/index.d.ts"; | ||
|
||
import { | ||
type Comment, | ||
type DocType, | ||
type Element, | ||
type ElementContent, | ||
type Root, | ||
type Text, | ||
import type { | ||
Comment, | ||
DocType, | ||
Element, | ||
ElementContent, | ||
Root, | ||
Text, | ||
} from "https://esm.sh/v113/@types/[email protected]/index.d.ts"; | ||
|
||
export type HastNode = Root | Element | DocType | Comment | Text; | ||
|
||
export { | ||
type ComponentChildren, | ||
type ComponentType, | ||
type VNode, | ||
export type { | ||
ComponentChildren, | ||
ComponentType, | ||
VNode, | ||
} from "https://esm.sh/v114/[email protected]/src/index.d.ts"; | ||
|
||
import { | ||
type ContainerDirective, | ||
type Directive, | ||
type LeafDirective, | ||
type TextDirective, | ||
import type { | ||
ContainerDirective, | ||
Directive, | ||
LeafDirective, | ||
TextDirective, | ||
} from "https://esm.sh/v114/[email protected]/index.d.ts"; | ||
|
||
export { type Directive }; | ||
export type { Directive }; | ||
|
||
declare module "https://esm.sh/v114/@types/[email protected]/index.d.ts" { | ||
interface StaticPhrasingContentMap { | ||
|
@@ -39,18 +39,21 @@ declare module "https://esm.sh/v114/@types/[email protected]/index.d.ts" { | |
} | ||
} | ||
|
||
import { type ComponentType } from "https://esm.sh/v114/[email protected]/src/index.d.ts"; | ||
import type { | ||
ComponentType, | ||
JSX, | ||
} from "https://esm.sh/v114/[email protected]/src/index.d.ts"; | ||
|
||
// deno-lint-ignore ban-types no-explicit-any | ||
export interface DirectiveHandler<P extends {} = any, C = any> { | ||
component: ComponentType<P>; | ||
component: ComponentType<P> | keyof JSX.IntrinsicElements; | ||
configure?: ComponentConfigurator<P, C>; | ||
} | ||
|
||
export type MaybePromise<T> = Promise<T> | T; | ||
export type ComponentConfigurator<TResult, TContext = void> = ( | ||
directive: Directive, | ||
context?: TContext | ||
context?: TContext, | ||
) => MaybePromise<TResult | false>; | ||
export type DirectiveOptions = Record<string, DirectiveHandler>; | ||
|
||
|