Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: use long for time in milliseconds #31369

Merged
merged 2 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/src/api/class-clock.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ await page.Clock.FastForwardAsync("30:00");

### param: Clock.fastForward.ticks
* since: v1.45
- `ticks` <[int]|[string]>
- `ticks` <[long]|[string]>

Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are "08" for eight seconds, "01:00" for one minute and "02:34:10" for two hours, 34 minutes and ten seconds.

Expand All @@ -65,7 +65,7 @@ Fake timers are used to manually control the flow of time in tests. They allow y

### option: Clock.install.time
* since: v1.45
- `time` <[int]|[string]|[Date]>
- `time` <[long]|[string]|[Date]>

Time to initialize with, current system time by default.

Expand Down Expand Up @@ -103,7 +103,7 @@ await page.Clock.RunForAsync("30:00");

### param: Clock.runFor.ticks
* since: v1.45
- `ticks` <[int]|[string]>
- `ticks` <[long]|[string]>

Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are "08" for eight seconds, "01:00" for one minute and "02:34:10" for two hours, 34 minutes and ten seconds.

Expand Down Expand Up @@ -147,7 +147,7 @@ await page.Clock.PauseAtAsync("2020-02-02");

### param: Clock.pauseAt.time
* since: v1.45
- `time` <[int]|[string]|[Date]>
- `time` <[long]|[string]|[Date]>


## async method: Clock.resume
Expand Down Expand Up @@ -195,7 +195,7 @@ await page.Clock.SetFixedTimeAsync("2020-02-02");

### param: Clock.setFixedTime.time
* since: v1.45
- `time` <[int]|[string]|[Date]>
- `time` <[long]|[string]|[Date]>

Time to be set.

Expand Down Expand Up @@ -238,4 +238,4 @@ await page.Clock.SetSystemTimeAsync("2020-02-02");

### param: Clock.setSystemTime.time
* since: v1.45
- `time` <[int]|[string]|[Date]>
- `time` <[long]|[string]|[Date]>
1 change: 1 addition & 0 deletions utils/doclint/documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ function csharpOptionOverloadSuffix(option, type) {
case 'Buffer': return 'Byte';
case 'Serializable': return 'Object';
case 'int': return 'Int';
case 'long': return 'Int64';
case 'Date': return 'Date';
}
throw new Error(`CSharp option "${option}" has unsupported type overload "${type}"`);
Expand Down
2 changes: 1 addition & 1 deletion utils/doclint/generateDotnetApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ function translateType(type, parent, generateNameCallback = t => t.name, optiona
* @param {Documentation.Type} type
*/
function registerModelType(typeName, type) {
if (['object', 'string', 'int'].includes(typeName))
if (['object', 'string', 'int', 'long'].includes(typeName))
return;
if (typeName.endsWith('Option'))
return;
Expand Down
2 changes: 1 addition & 1 deletion utils/generate_types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ class TypesGenerator {
return `{ [key: ${keyType}]: ${valueType}; }`;
}
let out = type.name;
if (out === 'int' || out === 'float')
if (out === 'int' || out === 'long' || out === 'float')
out = 'number';
if (out === 'Array' && direction === 'in')
out = 'ReadonlyArray';
Expand Down
Loading