Skip to content

Commit

Permalink
fix: respect member aliases (microsoft#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-s authored Feb 24, 2021
1 parent 0e6c493 commit a69a521
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions java/docs/api/class-browser.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Indicates that the browser is connected.
- `storageStatePath` <[Path]> Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [BrowserContext.storageState([options])](./api/class-browsercontext.mdx#browsercontextstoragestateoptions). Path to the file with saved storage state.
- `timezoneId` <[String]> Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) for a list of supported timezone IDs.
- `userAgent` <[String]> Specific user agent to use in this context.
- `viewport` <[null]|[Map]> Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.
- `viewportSize` <[null]|[Map]> Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.
- `width` <[int]> page width in pixels.
- `height` <[int]> page height in pixels.
- returns: <[BrowserContext]>
Expand Down Expand Up @@ -120,7 +120,7 @@ Creates a new browser context. It won't share cookies/cache with other browser c
- `storageStatePath` <[Path]> Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [BrowserContext.storageState([options])](./api/class-browsercontext.mdx#browsercontextstoragestateoptions). Path to the file with saved storage state.
- `timezoneId` <[String]> Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) for a list of supported timezone IDs.
- `userAgent` <[String]> Specific user agent to use in this context.
- `viewport` <[null]|[Map]> Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.
- `viewportSize` <[null]|[Map]> Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.
- `width` <[int]> page width in pixels.
- `height` <[int]> page height in pixels.
- returns: <[Page]>
Expand Down
2 changes: 1 addition & 1 deletion java/docs/api/class-browsertype.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ You can use `ignoreDefaultArgs` to filter out `--mute-audio` from default argume
- `timeout` <[double]> Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
- `timezoneId` <[String]> Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) for a list of supported timezone IDs.
- `userAgent` <[String]> Specific user agent to use in this context.
- `viewport` <[null]|[Map]> Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.
- `viewportSize` <[null]|[Map]> Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.
- `width` <[int]> page width in pixels.
- `height` <[int]> page height in pixels.
- returns: <[BrowserContext]>
Expand Down
6 changes: 3 additions & 3 deletions src/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ import TabItem from '@theme/TabItem';`);
let children;
const properties = type.deepProperties();
if (properties && properties.length)
children = properties.map(p => this.renderProperty(`\`${p.name}\``, p.type, p.spec, direction, false))
children = properties.map(p => this.renderProperty(`\`${p.alias}\``, p.type, p.spec, direction, false))
else if (spec && spec.length > 1)
children = spec.slice(1).map(s => md.clone(s));

Expand Down Expand Up @@ -437,10 +437,10 @@ new Generator('js', path.join(__dirname, '..', 'nodejs', 'docs'), {
let text;
let args = [];
if (member.kind === 'property')
text = `${member.clazz.varName}.${member.name}`;
text = `${member.clazz.varName}.${member.alias}`;

if (member.kind === 'event')
text = `${member.clazz.varName}.on('${member.name.toLowerCase()}')`;
text = `${member.clazz.varName}.on('${member.alias.toLowerCase()}')`;

if (member.kind === 'method') {
args = member.argsArray;
Expand Down

0 comments on commit a69a521

Please sign in to comment.