Skip to content

Commit

Permalink
refactor: Remove ddu property from UiActionArguments
Browse files Browse the repository at this point in the history
  • Loading branch information
4513ECHO committed Aug 26, 2024
1 parent 3418b06 commit 014e29c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
19 changes: 0 additions & 19 deletions denops/ddu/base/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ import type {
Context,
DduItem,
DduOptions,
PreviewContext,
Previewer,
SourceInfo,
UiActionCallback,
UiOptions,
} from "../types.ts";
import type { Denops } from "jsr:@denops/std@~7.0.3";
import type { Ddu } from "../ddu.ts";

export type UiActions<Params extends BaseParams> = Record<
string,
Expand Down Expand Up @@ -115,22 +112,6 @@ export type UpdateCursorArguments<Params extends BaseParams> = {
uiParams: Params;
};

export type UiActionArguments<Params extends BaseParams> = {
denops: Denops;
ddu: Ddu;
context: Context;
options: DduOptions;
uiOptions: UiOptions;
uiParams: Params;
actionParams: unknown;
getPreviewer?: (
denops: Denops,
item: DduItem,
actionParams: BaseParams,
previewContext: PreviewContext,
) => Promise<Previewer | undefined>;
};

export abstract class BaseUi<Params extends BaseParams> {
apiVersion = 2;

Expand Down
1 change: 0 additions & 1 deletion denops/ddu/ddu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,6 @@ export class Ddu {
} else {
ret = await action({
denops,
ddu: this,
context: this.#context,
options: this.#options,
uiOptions,
Expand Down
16 changes: 15 additions & 1 deletion denops/ddu/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { UiActionArguments } from "./base/ui.ts";
import type { Denops } from "jsr:@denops/std@~7.0.3";

export type DduExtType = "ui" | "source" | "filter" | "kind" | "column";
Expand Down Expand Up @@ -206,6 +205,21 @@ export type DduFilterItems = DduItem[] | {
postActionCommand?: string;
};

export type UiActionArguments<Params extends BaseParams> = {
denops: Denops;
context: Context;
options: DduOptions;
uiOptions: UiOptions;
uiParams: Params;
actionParams: unknown;
getPreviewer?: (
denops: Denops,
item: DduItem,
actionParams: BaseParams,
previewContext: PreviewContext,
) => Promise<Previewer | undefined>;
};

export type ActionArguments<Params extends BaseParams> = {
denops: Denops;
context: Context;
Expand Down

0 comments on commit 014e29c

Please sign in to comment.