UNPKG

@typescript-package/affix

Version:

A lightweight TypeScript library for the affix - prefix and suffix.

33 lines (32 loc) 996 B
import { Affix } from "./affix.abstract"; /** * @description A class to manage prefixes that can be applied to strings. * @export * @class Prefix * @template {string} [Value=string] The type of prefix constrained by the `string`. * @extends {Affix<Value>} */ export declare class Prefix<Value extends string = string> extends Affix<Value> { /** * @description Returns the `string` tag representation of the `Prefix` class when used in `Object.prototype.toString.call(instance)`. * @public * @readonly * @type {string} */ get [Symbol.toStringTag](): string; /** * @description Sanitizes the prefix with a `pattern`. * @public * @param {string} value * @param {RegExp} [pattern=Prefix.pattern] * @returns {string} */ static sanitize<Value extends string = string>(value: Value, pattern?: RegExp): Value; /** * @inheritdoc * @public * @static * @type {RegExp} */ static pattern: RegExp; }