Skip to content
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ If you want to file an issue for the Chrome DevTools Protocol, please open an is

Use the [protocol viewer](https://chromedevtools.github.io/devtools-protocol/) for navigating the protocol.

TypeScript definitions for the protocol's types are available in ['types/protocol.d.ts'](https://github.com/ChromeDevTools/devtools-protocol/tree/master/types). Mappings from Commands and events to these types are available in either generated `DomainApi` style in [`types/protocol-proxy-api.d.ts`](https://github.com/ChromeDevTools/devtools-protocol/blob/master/types/protocol-proxy-api.d.ts) or in simple name-to-type-interface style in [`types/protocol-mapping.d.ts`](https://github.com/ChromeDevTools/devtools-protocol/blob/master/types/protocol-mapping.d.ts).
TypeScript definitions for the protocol's types are available in ['types/protocol.d.ts'](https://github.com/ChromeDevTools/devtools-protocol/tree/master/types). Mappings from Commands and events to these types are available in either generated `DomainApi` style in [`types/protocol-proxy-api.d.ts`](https://github.com/ChromeDevTools/devtools-protocol/blob/master/types/protocol-proxy-api.d.ts) or in simple name-to-type-interface style in [`types/protocol-mapping.d.ts`](https://github.com/ChromeDevTools/devtools-protocol/blob/master/types/protocol-mapping.d.ts). Definitions for the protocol JSON schema itself are available in [`types/protocol-schema.d.ts`](https://github.com/ChromeDevTools/devtools-protocol/blob/master/types/protocol-schema.d.ts).

Also, this repo is published as the [`devtools-protocol`](https://www.npmjs.com/package/devtools-protocol) npm module.
1 change: 0 additions & 1 deletion scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
stubprotocolrepo
node_modules
2 changes: 1 addition & 1 deletion scripts/protocol-dts-generator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as fs from 'node:fs';
import * as path from 'node:path';
import type { IProtocol, Protocol as P } from './protocol-schema.d.ts';
import type { IProtocol, ProtocolSchema as P } from '../types/protocol-schema.d.ts';


// TODO: @noj validate this via https://github.com/andischerer/typescript-json-typesafe against protocol-schema.d.ts
Expand Down
30 changes: 0 additions & 30 deletions scripts/update-n-publish-docs.sh

This file was deleted.

25 changes: 18 additions & 7 deletions scripts/protocol-schema.d.ts → types/protocol-schema.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
/** Definition for protocol.json types */
export interface IProtocol {
version: Protocol.Version
domains: Protocol.Domain[]
version: ProtocolSchema.Version
domains: ProtocolSchema.Domain[]
}

export namespace Protocol {
export type ProtocolSchema = ProtocolSchema.Schema;

export namespace ProtocolSchema {
export interface Schema {
version: Version
domains: Domain[]
}

export interface Version {
major: string
minor: string
Expand Down Expand Up @@ -77,7 +84,7 @@ export namespace Protocol {
$ref: string
}

export interface PropertyBaseType {
export interface PropertyBaseType extends ExtraInformation {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lightning00Blade this work for you? cuz experimental and deprecated are universal modifiers.. and can apply to Property/Param/Return as well as the other types.

/** Name of param */
name: string
/** Is the property optional ? */
Expand All @@ -86,14 +93,18 @@ export namespace Protocol {
description?: string
}

type DomainType = {
export type DomainType = {
/** Name of property */
id: string
/** Description of the type */
description?: string
} & (StringType | ObjectType | ArrayType | PrimitiveType) & ExtraInformation;

type ProtocolType = StringType | ObjectType | ArrayType | PrimitiveType | RefType | AnyType;
export type ProtocolType = StringType | ObjectType | ArrayType | PrimitiveType | RefType | AnyType;

type PropertyType = PropertyBaseType & ProtocolType;
export type PropertyType = PropertyBaseType & ProtocolType;
}

export import Protocol = ProtocolSchema;