declaringPrototype() function

Walks up from a constructed instance to the prototype that actually declares the given method, mirroring legacy decoration where the decorator target is the declaring prototype. Falls back to the instance's own prototype.

Signature:

export declare function declaringPrototype(instance: any, methodName: string): any;

Parameters

Parameter

Type

Description

instance

any

this inside a standard decorator initializer

methodName

string

method to locate on the prototype chain

Returns:

any

the declaring prototype

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.