Skip to content

Commit

Permalink
add more jsdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbch committed Aug 23, 2023
1 parent a6c86ba commit 4f5e997
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/Mark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,10 @@ declare module '@tiptap/core' {
}
}

/**
* The Mark class is used to create custom mark extensions.
* @see https://tiptap.dev/api/extensions#create-a-new-extension
*/
export class Mark<Options = any, Storage = any> {
type = 'mark'

Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,10 @@ declare module '@tiptap/core' {
}
}

/**
* The Node class is used to create custom node extensions.
* @see https://tiptap.dev/api/extensions#create-a-new-extension
*/
export class Node<Options = any, Storage = any> {
type = 'node'

Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/NodeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import { DecorationWithType, NodeViewRendererOptions, NodeViewRendererProps } fr
import { isAndroid } from './utilities/isAndroid.js'
import { isiOS } from './utilities/isiOS.js'

/**
* Node views are used to customize the rendered DOM structure of a node.
* @see https://tiptap.dev/guide/node-views
*/
export class NodeView<
Component,
NodeEditor extends CoreEditor = CoreEditor,
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/PasteRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export type PasteRuleMatch = {

export type PasteRuleFinder = RegExp | ((text: string) => PasteRuleMatch[] | null | undefined)

/**
* Paste rules are used to react to pasted content.
* @see https://tiptap.dev/guide/custom-extensions/#paste-rules
*/
export class PasteRule {
find: PasteRuleFinder

Expand Down
1 change: 1 addition & 0 deletions packages/core/src/inputRules/markInputRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { callOrReturn } from '../utilities/callOrReturn.js'
/**
* Build an input rule that adds a mark when the
* matched text is typed into it.
* @see https://tiptap.dev/guide/custom-extensions/#input-rules
*/
export function markInputRule(config: {
find: InputRuleFinder
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/inputRules/nodeInputRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { callOrReturn } from '../utilities/callOrReturn.js'
/**
* Build an input rule that adds a node when the
* matched text is typed into it.
* @see https://tiptap.dev/guide/custom-extensions/#input-rules
*/
export function nodeInputRule(config: {
/**
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/inputRules/textInputRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { InputRule, InputRuleFinder } from '../InputRule.js'
/**
* Build an input rule that replaces text when the
* matched text is typed into it.
* @see https://tiptap.dev/guide/custom-extensions/#input-rules
*/
export function textInputRule(config: {
find: InputRuleFinder,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/inputRules/textblockTypeInputRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { callOrReturn } from '../utilities/callOrReturn.js'
* matched text is typed into it. When using a regular expresion you’ll
* probably want the regexp to start with `^`, so that the pattern can
* only occur at the start of a textblock.
* @see https://tiptap.dev/guide/custom-extensions/#input-rules
*/
export function textblockTypeInputRule(config: {
find: InputRuleFinder
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/inputRules/wrappingInputRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { callOrReturn } from '../utilities/callOrReturn.js'
* two nodes. You can pass a join predicate, which takes a regular
* expression match and the node before the wrapped node, and can
* return a boolean to indicate whether a join should happen.
* @see https://tiptap.dev/guide/custom-extensions/#input-rules
*/
export function wrappingInputRule(config: {
find: InputRuleFinder,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/pasteRules/markPasteRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { callOrReturn } from '../utilities/callOrReturn.js'
/**
* Build an paste rule that adds a mark when the
* matched text is pasted into it.
* @see https://tiptap.dev/guide/custom-extensions/#paste-rules
*/
export function markPasteRule(config: {
find: PasteRuleFinder
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/pasteRules/nodePasteRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { callOrReturn } from '../utilities/index.js'
/**
* Build an paste rule that adds a node when the
* matched text is pasted into it.
* @see https://tiptap.dev/guide/custom-extensions/#paste-rules
*/
export function nodePasteRule(config: {
find: PasteRuleFinder
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/pasteRules/textPasteRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { PasteRule, PasteRuleFinder } from '../PasteRule.js'
/**
* Build an paste rule that replaces text when the
* matched text is pasted into it.
* @see https://tiptap.dev/guide/custom-extensions/#paste-rules
*/
export function textPasteRule(config: {
find: PasteRuleFinder,
Expand Down

0 comments on commit 4f5e997

Please sign in to comment.