refactor(typert): keep the Remote marker mode as the 'stream' literal

This commit is contained in:
imccyu committed 2026-09-20 17:53:17 +08:00
1 parent ebdc1609c6
commit 77f1a493aa
1 file changed
+5 -5
+5 -5
View File
@@ -98,7 +98,7 @@ export interface RemoteMethodMarker {
/** Endpoint method when it differs from the implementation member. */
readonly exportName?: string
/** Stream methods yield many independently validated result items. */
readonly mode?: RemoteMethodOptions['mode']
readonly mode?: 'stream'
readonly invocation: RemoteInvocationMarker
}
@@ -122,7 +122,7 @@ interface RemoteInitializerContext<This extends object> {
interface StoredRemoteMethodMarker {
readonly exportName?: string
readonly mode?: RemoteMethodOptions['mode']
readonly mode?: 'stream'
readonly invocation: RemoteInvocationMarker
}
@@ -212,7 +212,7 @@ function remoteOptionMode(options: object): unknown {
function remoteDecorator(
invocation: RemoteInvocationMarker,
mode?: RemoteMethodOptions['mode'],
mode?: 'stream',
exportName?: string,
): RemoteMethodDecorator {
return function <This extends object, Args extends unknown[], Result>(
@@ -271,7 +271,7 @@ function readRemoteMethodDescriptor(prototype: object): RemoteMethodDescriptorV1
function addMarkerInitializer<This extends object>(
context: RemoteInitializerContext<This>,
invocation: RemoteInvocationMarker,
mode?: RemoteMethodOptions['mode'],
mode?: 'stream',
exportName?: string,
): void {
if (context.private || context.static || typeof context.name !== 'string') {
@@ -291,7 +291,7 @@ function mark(
prototype: object,
method: string,
invocation: RemoteInvocationMarker,
mode?: RemoteMethodOptions['mode'],
mode?: 'stream',
exportName?: string,
): void {
const descriptor = readRemoteMethodDescriptor(prototype)