Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove WP Prefix
  • Loading branch information
manzoorwanijk committed Nov 30, 2024
commit a4d2b20057daed9522dc2a2167abe66a2d5222f6
4 changes: 2 additions & 2 deletions packages/shortcode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ To access a raw representation of a shortcode, pass an `options` object, contain

_Type_

- `import('./types').WPShortcode`Shortcode instance.
- `import('./types').shortcode`Shortcode instance.

### fromMatch

Expand All @@ -56,7 +56,7 @@ _Parameters_

_Returns_

- `InstanceType<import('./types').WPShortcode>`: Shortcode instance.
- `InstanceType<import('./types').shortcode>`: Shortcode instance.

### next

Expand Down
6 changes: 3 additions & 3 deletions packages/shortcode/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export const attrs = memize( ( text ) => {
*
* @param {import('./types').Match} match Match array.
*
* @return {InstanceType<import('./types').WPShortcode>} Shortcode instance.
* @return {InstanceType<import('./types').shortcode>} Shortcode instance.
*/
export function fromMatch( match ) {
let type;
Expand Down Expand Up @@ -228,7 +228,7 @@ export function fromMatch( match ) {
* the `type` of the shortcode ('single', 'self-closing', or 'closed'), and a
* `content` string.
*
* @type {import('./types').WPShortcode} Shortcode instance.
* @type {import('./types').shortcode} Shortcode instance.
*/
const shortcode = Object.assign(
function ( options ) {
Expand Down Expand Up @@ -299,7 +299,7 @@ Object.assign( shortcode.prototype, {
* @param {(number|string)} attr Attribute key.
* @param {string} value Attribute value.
*
* @return {InstanceType< import('./types').WPShortcode >} Shortcode instance.
* @return {InstanceType< import('./types').shortcode >} Shortcode instance.
*/
set( attr, value ) {
this.attrs[ typeof attr === 'number' ? 'numeric' : 'named' ][ attr ] =
Expand Down
8 changes: 4 additions & 4 deletions packages/shortcode/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export type ReplaceCallback = ( shortcode: Shortcode ) => string;
/**
* WordPress Shortcode instance.
*/
export interface WPShortcode {
export interface shortcode {
new ( options: Partial< ShortcodeOptions > ): Shortcode & {
/**
* Transform the shortcode into a string.
Expand Down Expand Up @@ -104,12 +104,12 @@ export interface WPShortcode {
* @param {(number|string)} attr Attribute key.
* @param {string} value Attribute value.
*
* @return {InstanceType< WPShortcode >} Shortcode instance.
* @return {InstanceType< shortcode >} Shortcode instance.
*/
set: (
attr: string | number,
value: string
) => InstanceType< WPShortcode >;
) => InstanceType< shortcode >;
};

/**
Expand Down Expand Up @@ -142,7 +142,7 @@ export interface WPShortcode {
*
* @return Shortcode instance.
*/
fromMatch: ( match: Match ) => InstanceType< WPShortcode >;
fromMatch: ( match: Match ) => InstanceType< shortcode >;

/**
* Find the next matching shortcode.
Expand Down