diff --git a/.gitignore b/.gitignore index c37f7c5578..e8bd18a98e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,6 @@ yarn.lock /node6 /src/generated/* lib/ -/types/* jest-report.json drivers/ /docs/api.json diff --git a/package.json b/package.json index de8fb85e79..5d218d8c06 100644 --- a/package.json +++ b/package.json @@ -19,13 +19,12 @@ "tsc-installer": "tsc -p ./src/install/tsconfig.json", "doc": "node utils/doclint/cli.js", "test-infra": "folio utils/doclint/check_public_api/test/test.js && folio utils/doclint/preprocessor/test.js", - "lint": "npm run eslint && npm run tsc && npm run doc && npm run check-deps && npm run generate-channels && npm run test-types && npm run test-infra", + "lint": "npm run eslint && npm run tsc && npm run doc && npm run check-deps && npm run generate-channels && node utils/generate_types/ --check-clean && npm run test-types && npm run test-infra", "clean": "rimraf lib && rimraf types", "prepare": "node install-from-github.js", - "build": "node utils/runWebpack.js --mode='development' && tsc -p . && npm run generate-types && npm run generate-api-json", + "build": "node utils/runWebpack.js --mode='development' && tsc -p . && npm run generate-api-json", "watch": "node utils/watch.js", - "test-types": "npm run generate-types && npx -p typescript@3.7.5 tsc -p utils/generate_types/test/tsconfig.json && npm run typecheck-tests", - "generate-types": "node utils/generate_types/", + "test-types": "node utils/generate_types/ && npx -p typescript@3.7.5 tsc -p utils/generate_types/test/tsconfig.json && npm run typecheck-tests", "generate-channels": "node utils/generate_channels.js", "generate-api-json": "node utils/doclint/generateApiJson.js > docs/api.json", "typecheck-tests": "tsc -p ./test/", diff --git a/types/protocol.d.ts b/types/protocol.d.ts new file mode 100644 index 0000000000..2520c8ac46 --- /dev/null +++ b/types/protocol.d.ts @@ -0,0 +1,16834 @@ +// This is generated from /utils/protocol-types-generator/index.js +type binary = string; +export module Protocol { + export module Accessibility { + /** + * Unique accessibility node identifier. + */ + export type AXNodeId = string; + /** + * Enum of possible property types. + */ + export type AXValueType = "boolean"|"tristate"|"booleanOrUndefined"|"idref"|"idrefList"|"integer"|"node"|"nodeList"|"number"|"string"|"computedString"|"token"|"tokenList"|"domRelation"|"role"|"internalRole"|"valueUndefined"; + /** + * Enum of possible property sources. + */ + export type AXValueSourceType = "attribute"|"implicit"|"style"|"contents"|"placeholder"|"relatedElement"; + /** + * Enum of possible native property sources (as a subtype of a particular AXValueSourceType). + */ + export type AXValueNativeSourceType = "figcaption"|"label"|"labelfor"|"labelwrapped"|"legend"|"rubyannotation"|"tablecaption"|"title"|"other"; + /** + * A single source for a computed AX property. + */ + export interface AXValueSource { + /** + * What type of source this is. + */ + type: AXValueSourceType; + /** + * The value of this property source. + */ + value?: AXValue; + /** + * The name of the relevant attribute, if any. + */ + attribute?: string; + /** + * The value of the relevant attribute, if any. + */ + attributeValue?: AXValue; + /** + * Whether this source is superseded by a higher priority source. + */ + superseded?: boolean; + /** + * The native markup source for this value, e.g. a