chore(lint): declare contract callbacks property-style

unbound-method flags destructuring a method-style member (method
signatures are bivariant and exempt from the this-context check).
These contract members are all plain callbacks — declare them as
property-style function types so consumers can destructure them
without a false this-binding hazard. Type-level only.
This commit is contained in:
imccyu
2026-07-27 22:23:10 +08:00
parent 49c2e85ac7
commit 2adf44fb80
4 changed files with 20 additions and 20 deletions

View File

@@ -144,7 +144,7 @@ export interface ToolRowOwnerProps {
/** Frozen call slice: the running call or the settled result node. */ /** Frozen call slice: the running call or the settled result node. */
block: ToolCallBlock block: ToolCallBlock
/** Open the details panel for this call (session-level facility, supplied by the view). */ /** Open the details panel for this call (session-level facility, supplied by the view). */
openDetails(): void openDetails: () => void
} }
/** /**
@@ -175,21 +175,21 @@ export interface ConversationInjected {
* Connect the selected Workspace and open its reusable/new blank session. * Connect the selected Workspace and open its reusable/new blank session.
* When a blank session is already current, carry its draft to the target. * When a blank session is already current, carry its draft to the target.
*/ */
selectWorkspace(workspaceId: WorkspaceId): Promise<void> selectWorkspace: (workspaceId: WorkspaceId) => Promise<void>
} }
/** Business callbacks injected into the strict session content seat. */ /** Business callbacks injected into the strict session content seat. */
export interface ConversationSessionInjected { export interface ConversationSessionInjected {
/** Views projected from the `conversation.view` slot ledger. */ /** Views projected from the `conversation.view` slot ledger. */
views: { views: {
list(): readonly ViewTab[] list: () => readonly ViewTab[]
subscribe(fn: () => void): () => void subscribe: (fn: () => void) => () => void
version(): number version: () => number
} }
/** Bind the input machine's draft persistence mirror to the session store. */ /** Bind the input machine's draft persistence mirror to the session store. */
bindDraftMirror(write: (text: string) => void): () => void bindDraftMirror: (write: (text: string) => void) => () => void
/** Select a real Session through the runtime navigation owner. */ /** Select a real Session through the runtime navigation owner. */
open(sessionId: SessionId): void open: (sessionId: SessionId) => void
} }
/** /**
@@ -219,7 +219,7 @@ export interface ComposerBarInjected {
/** The InputBar-exclusive keyboard/DOM command face (decision 20 private plane). */ /** The InputBar-exclusive keyboard/DOM command face (decision 20 private plane). */
keyboard: ComposerKeyboard keyboard: ComposerKeyboard
/** Cancel the in-flight turn. */ /** Cancel the in-flight turn. */
stop(): void stop: () => void
} }
/** /**
@@ -275,8 +275,8 @@ export type ConversationSessionSlotProps =
*/ */
export interface ChatViewInjected { export interface ChatViewInjected {
/** Selection write + details panel opening in one gesture (store action + layout orchestration). */ /** Selection write + details panel opening in one gesture (store action + layout orchestration). */
openDetails(target: SelectionTarget): void openDetails: (target: SelectionTarget) => void
loadOlder(): void loadOlder: () => void
} }
/** Full chat-view component props: runtime share & the declared toolview hole's render share & store share & injected share. */ /** Full chat-view component props: runtime share & the declared toolview hole's render share & store share & injected share. */
@@ -290,7 +290,7 @@ export type ChatViewSlotProps =
*/ */
export interface DetailsInjected { export interface DetailsInjected {
/** Close the details panel (layout geometry stays with ctx.layout). */ /** Close the details panel (layout geometry stays with ctx.layout). */
closeDetails(): void closeDetails: () => void
} }
/** Full details-slot component props: selection arrives through the shared store, call material through useSession. */ /** Full details-slot component props: selection arrives through the shared store, call material through useSession. */
@@ -300,6 +300,6 @@ export type DetailsSlotProps = PropsRuntime<'details'> & PropsStore<ChatStore> &
export interface EmptyWorkspaceOwnerProps { export interface EmptyWorkspaceOwnerProps {
open: boolean open: boolean
anchorRef?: RefObject<HTMLElement> anchorRef?: RefObject<HTMLElement>
onPick(workspaceId: WorkspaceId): void onPick: (workspaceId: WorkspaceId) => void
onClose(): void onClose: () => void
} }

View File

@@ -34,5 +34,5 @@ export interface MenuViewInjected {
* @param source - source (group) name. * @param source - source (group) name.
* @param index - candidate index within the group. * @param index - candidate index within the group.
*/ */
onPick(source: string, index: number): void onPick: (source: string, index: number) => void
} }

View File

@@ -59,9 +59,9 @@ export type WorkspaceBrowserProps =
*/ */
export type WorkspacePickerInjected = { export type WorkspacePickerInjected = {
/** Explicitly create or adopt a real Workspace before targeting a Session. */ /** Explicitly create or adopt a real Workspace before targeting a Session. */
createWorkspace(input: { name: string } | { path: string }): Promise<WorkspaceView> createWorkspace: (input: { name: string } | { path: string }) => Promise<WorkspaceView>
/** Ask the local Host to open its native single-directory picker. */ /** Ask the local Host to open its native single-directory picker. */
pickDirectory(): Promise<string | null> pickDirectory: () => Promise<string | null>
} }
/** /**

View File

@@ -46,13 +46,13 @@ export type LoaderStatus = Record<string, LoaderEntryState>
/** Minimal observable snapshot the kernel components consume (useSyncExternalStore shape). */ /** Minimal observable snapshot the kernel components consume (useSyncExternalStore shape). */
export interface KernelSignal<T> { export interface KernelSignal<T> {
/** Current value (stable reference between changes). */ /** Current value (stable reference between changes). */
getSnapshot(): T getSnapshot: () => T
/** /**
* Subscribe to changes. * Subscribe to changes.
* @param fn - change listener. * @param fn - change listener.
* @returns the unsubscribe disposer. * @returns the unsubscribe disposer.
*/ */
subscribe(fn: () => void): () => void subscribe: (fn: () => void) => () => void
} }
/** Writable one-value signal (settled flag, boot failure report). */ /** Writable one-value signal (settled flag, boot failure report). */
@@ -61,7 +61,7 @@ export interface KernelValueSignal<T> extends KernelSignal<T> {
* Publish a new value and notify subscribers. * Publish a new value and notify subscribers.
* @param next - the new value. * @param next - the new value.
*/ */
set(next: T): void set: (next: T) => void
} }
/** /**
@@ -90,7 +90,7 @@ export interface LoaderStatusStore extends KernelSignal<LoaderStatus> {
* @param id - entry name. * @param id - entry name.
* @param state - projected fiber state. * @param state - projected fiber state.
*/ */
set(id: string, state: LoaderEntryState): void set: (id: string, state: LoaderEntryState) => void
} }
/** /**