Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Extend edit event options with createHistoryEntry flag #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
4 changes: 4 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ export type EditDetailV2<E extends Edit = Edit> = {
edit: E;
title?: string;
squash?: boolean;
createHistoryEntry?: boolean;
}

export type EditEventV2<E extends Edit = Edit> = CustomEvent<EditDetailV2<E>>;

export type EditEventOptions = {
title?: string;
squash?: boolean;
createHistoryEntry?: boolean;
}

export function newEditEventV2<E extends Edit>(edit: E, options: EditEventOptions): EditEventV2<E> {
Expand All @@ -127,6 +129,8 @@ Its `title` property is a human-readable description of the edit for displaying

The `squash` flag indicates whether the edit should be merged with the previous edit in the history.

The `createHistoryEntry` flag decides if a history entry should be created. Defaults to `true`.

#### `Edit` type

The `EditDetailV2` defined above contains an `edit` of this type:
Expand Down