---
title: "SpecFormat"
description: "The `SpecFormat` entity."
section: "Reference"
group: "Types"
order: 209
---

## Definition

```ts
type SpecFormat = "openapi-3.0" | "openapi-3.1" | "swagger-2.0";
```

## Fields

| Field               | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Notes                                                                                                                                                      |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `toString`          | `() => string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | `required` — Returns a string representation of a string.                                                                                                  |
| `charAt`            | `(pos: number) => string`                                                                                                                                                                                                                                                                                                                                                                                                                                                        | `required` — Returns the character at the specified index.                                                                                                 |
| `charCodeAt`        | `(index: number) => number`                                                                                                                                                                                                                                                                                                                                                                                                                                                      | `required` — Returns the Unicode value of the character at the specified location.                                                                         |
| `concat`            | `(...strings: string[]) => string`                                                                                                                                                                                                                                                                                                                                                                                                                                               | `required` — Returns a string that contains the concatenation of two or more strings.                                                                      |
| `indexOf`           | `(searchString: string, position?: number) => number`                                                                                                                                                                                                                                                                                                                                                                                                                            | `required` — Returns the position of the first occurrence of a substring.                                                                                  |
| `lastIndexOf`       | `(searchString: string, position?: number) => number`                                                                                                                                                                                                                                                                                                                                                                                                                            | `required` — Returns the last occurrence of a substring in the string.                                                                                     |
| `localeCompare`     | `{ (that: string): number; (that: string, locales?: string \| string[], options?: Intl.CollatorOptions): number; (that: string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions): number; }`                                                                                                                                                                                                                                                                      | `required` — Determines whether two strings are equivalent in the current locale.                                                                          |
| `match`             | `{ (regexp: string \| RegExp): RegExpMatchArray \| null; (matcher: { [Symbol.match](string: string): RegExpMatchArray \| null; }): RegExpMatchArray \| null; }`                                                                                                                                                                                                                                                                                                                  | `required` — Matches a string with a regular expression, and returns an array containing the results of that search.                                       |
| `replace`           | `{ (searchValue: string \| RegExp, replaceValue: string): string; (searchValue: string \| RegExp, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; (searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; }` | `required` — Replaces text in a string, using a regular expression or search string.                                                                       |
| `search`            | `{ (regexp: string \| RegExp): number; (searcher: { [Symbol.search](string: string): number; }): number; }`                                                                                                                                                                                                                                                                                                                                                                      | `required` — Finds the first substring match in a regular expression search.                                                                               |
| `slice`             | `(start?: number, end?: number) => string`                                                                                                                                                                                                                                                                                                                                                                                                                                       | `required` — Returns a section of a string.                                                                                                                |
| `split`             | `{ (separator: string \| RegExp, limit?: number): string[]; (splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[]; }`                                                                                                                                                                                                                                                                                                              | `required` — Split a string into substrings using the specified separator and return them as an array.                                                     |
| `substring`         | `(start: number, end?: number) => string`                                                                                                                                                                                                                                                                                                                                                                                                                                        | `required` — Returns the substring at the specified location within a String object.                                                                       |
| `toLowerCase`       | `() => string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | `required` — Converts all the alphabetic characters in a string to lowercase.                                                                              |
| `toLocaleLowerCase` | `{ (locales?: string \| string[]): string; (locales?: Intl.LocalesArgument): string; }`                                                                                                                                                                                                                                                                                                                                                                                          | `required` — Converts all alphabetic characters to lowercase, taking into account the host environment's current locale.                                   |
| `toUpperCase`       | `() => string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | `required` — Converts all the alphabetic characters in a string to uppercase.                                                                              |
| `toLocaleUpperCase` | `{ (locales?: string \| string[]): string; (locales?: Intl.LocalesArgument): string; }`                                                                                                                                                                                                                                                                                                                                                                                          | `required` — Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. |
| `trim`              | `() => string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | `required` — Removes the leading and trailing white space and line terminator characters from a string.                                                    |
| `length`            | `number`                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | `required` — Returns the length of a String object.                                                                                                        |
| `substr`            | `(from: number, length?: number) => string`                                                                                                                                                                                                                                                                                                                                                                                                                                      | `required` — Gets a substring beginning at the specified location and having the specified length.                                                         |
| `valueOf`           | `() => string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | `required` — Returns the primitive value of the specified object.                                                                                          |
| `codePointAt`       | `(pos: number) => number \| undefined`                                                                                                                                                                                                                                                                                                                                                                                                                                           | `required` — Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point                                                      |

value of the UTF-16 encoded code point starting at the string element at position pos in
the String resulting from converting this object to a String.
If there is no element at that position, the result is undefined.
If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. |
| `includes` | `(searchString: string, position?: number) => boolean` | `required` — Returns true if searchString appears as a substring of the result of converting this
object to a String, at one or more positions that are
greater than or equal to position; otherwise, returns false. |
| `endsWith` | `(searchString: string, endPosition?: number) => boolean` | `required` — Returns true if the sequence of elements of searchString converted to a String is the
same as the corresponding elements of this object (converted to a String) starting at
endPosition – length(this). Otherwise returns false. |
| `normalize` | `{ (form: "NFC" \| "NFD" \| "NFKC" \| "NFKD"): string; (form?: string): string; }` | `required` — Returns the String value result of normalizing the string into the normalization form
named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. |
| `repeat` | `(count: number) => string` | `required` — Returns a String value that is made from count copies appended together. If count is 0,
the empty string is returned. |
| `startsWith` | `(searchString: string, position?: number) => boolean` | `required` — Returns true if the sequence of elements of searchString converted to a String is the
same as the corresponding elements of this object (converted to a String) starting at
position. Otherwise returns false. |
| `anchor` | `(name: string) => string` | `required` — Returns an `<a>` HTML anchor element and sets the name attribute to the text value |
| `big` | `() => string` | `required` — Returns a `<big>` HTML element |
| `blink` | `() => string` | `required` — Returns a `<blink>` HTML element |
| `bold` | `() => string` | `required` — Returns a `<b>` HTML element |
| `fixed` | `() => string` | `required` — Returns a `<tt>` HTML element |
| `fontcolor` | `(color: string) => string` | `required` — Returns a `<font>` HTML element and sets the color attribute value |
| `fontsize` | `{ (size: number): string; (size: string): string; }` | `required` — Returns a `<font>` HTML element and sets the size attribute value |
| `italics` | `() => string` | `required` — Returns an `<i>` HTML element |
| `link` | `(url: string) => string` | `required` — Returns an `<a>` HTML element and sets the href attribute value |
| `small` | `() => string` | `required` — Returns a `<small>` HTML element |
| `strike` | `() => string` | `required` — Returns a `<strike>` HTML element |
| `sub` | `() => string` | `required` — Returns a `<sub>` HTML element |
| `sup` | `() => string` | `required` — Returns a `<sup>` HTML element |
| `padStart` | `(maxLength: number, fillString?: string) => string` | `required` — Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.
The padding is applied from the start (left) of the current string. |
| `padEnd` | `(maxLength: number, fillString?: string) => string` | `required` — Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.
The padding is applied from the end (right) of the current string. |
| `trimEnd` | `() => string` | `required` — Removes the trailing white space and line terminator characters from a string. |
| `trimStart` | `() => string` | `required` — Removes the leading white space and line terminator characters from a string. |
| `trimLeft` | `() => string` | `required` — Removes the leading white space and line terminator characters from a string. |
| `trimRight` | `() => string` | `required` — Removes the trailing white space and line terminator characters from a string. |
| `matchAll` | `(regexp: RegExp) => RegExpStringIterator<RegExpExecArray>` | `required` — Matches a string with a regular expression, and returns an iterable of matches
containing the results of that search. |
| `replaceAll` | `{ (searchValue: string \| RegExp, replaceValue: string): string; (searchValue: string \| RegExp, replacer: (substring: string, ...args: any[]) => string): string; }` | `required` — Replace all instances of a substring in a string, using a regular expression or search string. |
| `at` | `(index: number) => string \| undefined` | `required` — Returns a new String consisting of the single UTF-16 code unit located at the specified index. |
| `__@iterator@390` | `() => StringIterator<string>` | `required` — Iterator |
