-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
types: better types #1166
types: better types #1166
Changes from all commits
631604f
462e231
20f5428
43f3553
2d3c7d5
6c657b8
039e98d
a3763b4
a70f907
fd02ed4
98b718a
5b16a76
81b1dc3
72dbef9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ lib/ | |
playwright-*.tgz | ||
/web.js | ||
/web.js.map | ||
/types/* |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,11 +31,12 @@ | |
"test-infra": "node utils/doclint/check_public_api/test/test.js && node utils/doclint/preprocessor/test.js && node utils/testrunner/test/test.js", | ||
"lint": "npm run eslint && npm run tsc && npm run doc && npm run test-infra", | ||
"debug-test": "node --inspect-brk test/test.js", | ||
"clean": "rimraf lib", | ||
"clean": "rimraf lib && rimraf types", | ||
"prepare": "node install-from-github.js", | ||
"build": "node utils/runWebpack.js --mode='development' && tsc -p .", | ||
"watch": "node utils/runWebpack.js --mode='development' --watch --silent | tsc -w -p .", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need something for watch? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure. I don't think it works right now in build though. It depends on the protocol.ts file to be generated, but the protocol generator requires the project to be built. I'll move it to a separate command that runs on bots, test, and before publishing. |
||
"version": "node utils/sync_package_versions.js && npm run doc" | ||
"version": "node utils/sync_package_versions.js && npm run doc", | ||
"generate-types": "node utils/generate_types/" | ||
}, | ||
"author": { | ||
"name": "Microsoft Corporation" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import * as types from 'playwright-core/types/types'; | ||
|
||
export * from 'playwright-core/types/types'; | ||
export const chromium: types.BrowserType<types.ChromiumBrowser>; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import * as types from 'playwright-core/types/types'; | ||
|
||
export * from 'playwright-core/types/types'; | ||
export const firefox: types.BrowserType<types.FirefoxBrowser>; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import * as types from 'playwright-core/types/types'; | ||
|
||
export * from 'playwright-core/types/types'; | ||
export const webkit: types.BrowserType<types.WebKitBrowser>; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,22 @@ | ||
export * from "playwright-core"; | ||
/** | ||
* Copyright (c) Microsoft Corporation. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import * as types from 'playwright-core/types/types'; | ||
|
||
export * from 'playwright-core/types/types'; | ||
export const webkit: types.BrowserType<types.WebKitBrowser>; | ||
export const chromium: types.BrowserType<types.ChromiumBrowser>; | ||
export const firefox: types.BrowserType<types.FirefoxBrowser>; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,3 @@ try { | |
throw new Error('ERROR: Playwright did not download browsers'); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ interface TestSetup<STATE> { | |
MAC: boolean; | ||
LINUX: boolean; | ||
WIN: boolean; | ||
playwright: import('../src/server/browserType').BrowserType; | ||
playwright: import('../src/server/browserType').BrowserType<import('../src/browser').Browser>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's migrate this whole file to public types in a follow up. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Definitely! |
||
selectors: import('../src/selectors').Selectors; | ||
expect<T>(value: T): Expect<T>; | ||
defaultBrowserOptions: import('../src/server/browserType').LaunchOptions; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about selectors, web, errors and devices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is web public right now? How is it accessed? I did the others.