@@ -40,6 +40,8 @@ async function generateWebKitProtocol(folderPath) {
40
40
console . log ( `Wrote protocol.ts for WebKit to ${ path . relative ( process . cwd ( ) , outputPath ) } ` ) ;
41
41
}
42
42
43
+ const conditionFilter = command => command . condition !== 'defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY' ;
44
+
43
45
function jsonToTS ( json ) {
44
46
return `// This is generated from /utils/protocol-types-generator/index.js
45
47
type binary = string;
@@ -69,7 +71,7 @@ export module Protocol {${json.domains.map(domain => `${domain.description ? `
69
71
${ parameter . name } ${ parameter . optional ? '?' : '' } : ${ typeOfProperty ( parameter ) } ;` ) . join ( `` ) }
70
72
}` : `
71
73
export type ${ event . name } Payload = void;` } `) . join ( '' ) }
72
- ${ ( domain . commands || [ ] ) . map ( command => `${ command . description ? `
74
+ ${ ( domain . commands || [ ] ) . filter ( conditionFilter ) . map ( command => `${ command . description ? `
73
75
/**
74
76
* ${ command . description }
75
77
*/` : '' }
@@ -90,10 +92,10 @@ export module Protocol {${json.domains.map(domain => `${domain.description ? `
90
92
export interface Events {${ json . domains . map ( domain => ( domain . events || [ ] ) . map ( event => `
91
93
"${ domain . domain } .${ event . name } ": ${ domain . domain } .${ event . name } Payload;` ) . join ( '' ) ) . join ( '' ) }
92
94
}
93
- export interface CommandParameters {${ json . domains . map ( domain => ( domain . commands || [ ] ) . map ( command => `
95
+ export interface CommandParameters {${ json . domains . map ( domain => ( domain . commands || [ ] ) . filter ( conditionFilter ) . map ( command => `
94
96
"${ domain . domain } .${ command . name } ": ${ domain . domain } .${ command . name } Parameters;` ) . join ( '' ) ) . join ( '' ) }
95
97
}
96
- export interface CommandReturnValues {${ json . domains . map ( domain => ( domain . commands || [ ] ) . map ( command => `
98
+ export interface CommandReturnValues {${ json . domains . map ( domain => ( domain . commands || [ ] ) . filter ( conditionFilter ) . map ( command => `
97
99
"${ domain . domain } .${ command . name } ": ${ domain . domain } .${ command . name } ReturnValue;` ) . join ( '' ) ) . join ( '' ) }
98
100
}
99
101
}
0 commit comments