-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Description
What is the issue and how can we reproduce it?
The current typing here is bound to the key anyName

this should be more generic something like
oComponentTargetInfo?: {
/**
* The name of a target which loads a component. This target is used in the Route which is specified by
* `sName`.
*/
[key:string]: {
/**
* The name of the route which should be matched after this navTo call.
*/
route?: string;
/**
* The parameters for the route. See the documentation of the `oParameters`.
*/
parameters?: object;
/**
* The information for the targets within a nested component. This shares the same structure with the `oComponentTargetInfo`
* parameter.
*/
componentTargetInfo?: object;
};
},
I already tried to change the JSDoc of the Routers nav to method to:
/**
* @typedef {object} oComponentTargetInfo
* @property {string} [route] The name of the route which should be matched after this
* navTo call.
* @property {object} [parameters] The parameters for the route. See the
* documentation of the <code>oParameters</code>.
* @property {object} [componentTargetInfo] The information for the targets within a
* nested component. This shares the same structure with the <code>oComponentTargetInfo</code> parameter.
* @public
*/
/**
* Navigates to a specific route defining a set of parameters.
*
* The parameters will be URI encoded - the characters ; , / ? : @ & = + $ are reserved and will not be encoded.
* If you want to use special characters in your <code>oParameters</code>, you have to encode them (encodeURIComponent).
*
* If the given route name can't be found, an error message is logged to the console and the hash will be
* changed to the empty string.
*
* This method excecutes following steps:
* 1. Interpolates the pattern with the given parameters
* 2. Sets the interpolated pattern to the browser's hash
* 3. Reacts to the browser's <code>hashchange</code> event to find out the route which matches the hash
*
* If there are multiple routes that have the same pattern,
* the call of navTo with a specific route won't necessarily trigger the matching process of this route.
* In the end, the first route in the router configuration list that matches the browser hash will be chosen.
*
* If the browser hash is already set with the interpolated pattern from the navTo call,
* nothing will happen because the browser won't fire <code>hashchange</code> event in this case.
*
* @param {string} sName The name of the route
* @param {object} [oParameters] The parameters for the route.
* As of Version 1.75 the recommendation is naming the query parameter with a leading "?" character,
* which is identical to the definition in the route's pattern. The old syntax without a leading
* "?" character is deprecated.
* e.g. <b>Route:</b> <code>{parameterName1}/:parameterName2:/{?queryParameterName}</code>
* <b>Parameter:</b>
* <pre>
* {
* parameterName1: "parameterValue1",
* parameterName2: "parameterValue2",
* "?queryParameterName": {
* queryParameterName1: "queryParameterValue1"
* }
* }
* </pre>
* @param {Record<string,oComponentTargetInfo>} [oComponentTargetInfo]
* Information for route name and parameters of the router in nested components. When any target
* of the route which is specified with the <code>sName</code> parameter loads a component and a
* route of this component whose pattern is different than an empty string should be matched
* directly with this navTo call, the route name and its parameters can be given by using this
* parameter. Information for deeper nested component target can be given within the
* <code>componentTargetInfo</code> property which contains the same properties as the top
* level.
* @param {boolean} [bReplace=false]
* If set to <code>true</code>, the hash is replaced, and there will be no entry in the browser
* history. If set to <code>false</code>, the hash is set and the entry is stored in the browser
* history.
* @ui5-omissible-params oComponentTargetInfo
* @public
* @returns {this} this for chaining.
* @throws {Error} Error will be thrown when any mandatory parameter in the route's pattern is missing from
* <code>oParameters</code> or assigned with empty string.
*/
This would generate the right typescript typings but would render the documentation in the Demokit wrong:

Which OpenUI5 version is your project targeting?
1.136.6
Is the issue device- or browser-specific?
No response
Confirmation
- I have searched the existing issues and reviewed the relevant documentation as well as the API reference.
- I am not disclosing any internal or sensitive information.