vue-markdown-wasm
Version:
markdown-wasm for vue 2 & 3
169 lines • 5.94 kB
TypeScript
import { MarkdownOutput, ParseFlagsType } from '@logue/markdown-wasm';
import { PropType, Ref } from 'vue-demi';
/** Vue Markdown Component */
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
/** Model value */
modelValue: {
type: PropType<string | Uint8Array>;
default: string;
};
/**
* Using tag
*/
tag: {
type: StringConstructor;
default: string;
};
/** Customize parsing */
parseFlags: {
type: PropType<ParseFlagsType>;
default: 1 | 2 | 4 | 256 | 512 | 2048;
};
/** Select output format. */
format: {
type: PropType<"html" | "xhtml">;
default: string;
};
/**
* bytes=true causes parse() to return the result as a Uint8Array instead of a string.
*
* The returned Uint8Array is only valid until the next call to parse().
* If you need to keep the returned data around, call Uint8Array.slice() to make a copy,
* as each call to parse() uses the same underlying memory.
*
* This only provides a performance benefit when you never need to convert the output
* to a string. In most cases you're better off leaving this unset or false.
*/
bytes: {
type: BooleanConstructor;
default: boolean;
};
/** Allow "javascript:" in links */
allowJsUri: {
type: BooleanConstructor;
default: boolean;
};
/**
* Optional callback which if provided is called for each code block.
* langname holds the "language tag", if any, of the block.
*
* The returned value is inserted into the resulting HTML verbatim, without HTML escaping.
* Thus, you should take care of properly escaping any special HTML characters.
*
* If the function returns null or undefined, or an exception occurs, the body will be
* included as-is after going through HTML escaping.
*
* Note that use of this callback has an adverse impact on performance as it casues
* calls and data to be bridged between WASM and JS on every invocation.
*/
onCodeBlock: {
type: PropType<(langname: string, body: Uint8Array) => MarkdownOutput>;
};
/** Enable Debug log. default is false */
debug: {
type: BooleanConstructor;
default: boolean;
};
/** Output special characters as entity reference characters */
verbatimEntities: {
type: BooleanConstructor;
default: boolean;
};
/** Disable anchor tag in headlines. Defaults to `false` */
disableHeadlineAnchors: {
type: BooleanConstructor;
default: boolean;
};
}>, {
placeholder: Ref<HTMLElement | undefined, HTMLElement | undefined>;
html: Ref<MarkdownOutput, MarkdownOutput>;
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
render: (value: MarkdownOutput) => true;
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
/** Model value */
modelValue: {
type: PropType<string | Uint8Array>;
default: string;
};
/**
* Using tag
*/
tag: {
type: StringConstructor;
default: string;
};
/** Customize parsing */
parseFlags: {
type: PropType<ParseFlagsType>;
default: 1 | 2 | 4 | 256 | 512 | 2048;
};
/** Select output format. */
format: {
type: PropType<"html" | "xhtml">;
default: string;
};
/**
* bytes=true causes parse() to return the result as a Uint8Array instead of a string.
*
* The returned Uint8Array is only valid until the next call to parse().
* If you need to keep the returned data around, call Uint8Array.slice() to make a copy,
* as each call to parse() uses the same underlying memory.
*
* This only provides a performance benefit when you never need to convert the output
* to a string. In most cases you're better off leaving this unset or false.
*/
bytes: {
type: BooleanConstructor;
default: boolean;
};
/** Allow "javascript:" in links */
allowJsUri: {
type: BooleanConstructor;
default: boolean;
};
/**
* Optional callback which if provided is called for each code block.
* langname holds the "language tag", if any, of the block.
*
* The returned value is inserted into the resulting HTML verbatim, without HTML escaping.
* Thus, you should take care of properly escaping any special HTML characters.
*
* If the function returns null or undefined, or an exception occurs, the body will be
* included as-is after going through HTML escaping.
*
* Note that use of this callback has an adverse impact on performance as it casues
* calls and data to be bridged between WASM and JS on every invocation.
*/
onCodeBlock: {
type: PropType<(langname: string, body: Uint8Array) => MarkdownOutput>;
};
/** Enable Debug log. default is false */
debug: {
type: BooleanConstructor;
default: boolean;
};
/** Output special characters as entity reference characters */
verbatimEntities: {
type: BooleanConstructor;
default: boolean;
};
/** Disable anchor tag in headlines. Defaults to `false` */
disableHeadlineAnchors: {
type: BooleanConstructor;
default: boolean;
};
}>> & Readonly<{
onRender?: ((value: MarkdownOutput) => any) | undefined;
}>, {
modelValue: string | Uint8Array<ArrayBufferLike>;
tag: string;
parseFlags: ParseFlagsType;
format: "html" | "xhtml";
bytes: boolean;
allowJsUri: boolean;
debug: boolean;
verbatimEntities: boolean;
disableHeadlineAnchors: boolean;
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
export default _default;
//# sourceMappingURL=VueMarkdown.d.ts.map