Files
site/node_modules/stringify-entities/lib/util/format-smart.d.ts
T
site-admin 3ac81d5a52
deploy / build-and-publish (push) Successful in 1m37s
the editable site (validation-lab)
2026-11-21 08:03:55 +01:00

46 lines
1.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Configurable ways to encode a character yielding pretty or small results.
*
* @param {number} code
* Code point.
* @param {number} next
* Code point of the next character (or `NaN`).
* @param {FormatSmartOptions} options
* Configuration.
* @returns {string}
* Character reference.
*/
export function formatSmart(code: number, next: number, options: FormatSmartOptions): string;
/**
* Configuration for `stringifyEntities` that is not in `LightOptions`.
*/
export type FormatSmartOptions = {
/**
* Create character references which don’t fail in attributes
* (default: `false`);
* only applies when operating dangerously with
* `omitOptionalSemicolons: true`.
*/
attribute?: boolean | null | undefined;
/**
* Whether to omit semicolons when possible (default: `false`);
* this creates what HTML calls “parse errors” but is otherwise still valid
* HTML,
* so don’t use this except when building a minifier;
* omitting semicolons is possible for certain named and numeric references in
* some cases.
*/
omitOptionalSemicolons?: boolean | null | undefined;
/**
* Prefer named character references (`&`) where possible
* (default: `false`).
*/
useNamedReferences?: boolean | null | undefined;
/**
* Prefer the shortest possible reference,
* if that results in less bytes (default: `false`);
* `useNamedReferences` can be omitted when using `useShortestReferences`.
*/
useShortestReferences?: boolean | null | undefined;
};
//# sourceMappingURL=format-smart.d.ts.map