ManagedObject.extend third optional parameter "FNMetaImpl?"

Open
#520 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
typescript
Domain
tooling

Research direction

Start with the ManagedObject.extend documentation and the TypeScript builder/transpiler path that handles the class definition. Trace how the second-parameter metadata is represented and whether the third FNMetaImpl parameter is exposed. Done means establishing and documenting a supported way to provide a custom metadata constructor, or clarifying that none exists.

Written by the indexing model from the issue text.

Description

In the ManagedObject "extend" function documentation you can see that it is possible to use the third parameter for specifying a Constructor function for the metadata object.

Since in TS you don't call directly the "extend" function but rather the builder/transpiler does it, how can one pass a custom metadata costructor to the definition of a custom class?

Since metadata information (that are part of the second parameter "oClassInfo?" in the "extend" call) are automagically passed by defining a "public static metadata" (or "static readonly metadata", not very clear) attribute in the class (and doesn't always work...) , I suspect that there mey be something along the same line, like defining a static "metadataImplementation" or similar?

Is there an alternative way to define and use a custom metadata constructor for my custom class?

Thanks

Dominant language
TypeScript
Stars
213
Forks
35
Avg merge
37m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from UI5/typescript

All issues in UI5/typescript

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.