Skip to content

Commit

Permalink
Expose *-transition properties in Style Spec types (internal-1433)
Browse files Browse the repository at this point in the history
  • Loading branch information
stepankuzmin authored and mourner committed May 22, 2024
1 parent dd68665 commit cd62ed0
Show file tree
Hide file tree
Showing 2 changed files with 138 additions and 17 deletions.
12 changes: 11 additions & 1 deletion build/generate-flow-typed-style-spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable flowtype/require-valid-file-annotation */

import fs from 'fs';
import assert from 'assert';
import spec from '../src/style-spec/reference/v8.json';
Expand Down Expand Up @@ -71,7 +73,15 @@ function flowObjectDeclaration(key, properties) {
function flowObject(properties, indent, sealing = '') {
return `{${sealing}
${Object.keys(properties)
.map(k => ` ${indent}${flowProperty(k, properties[k])}`)
.map(k => {
const property = ` ${indent}${flowProperty(k, properties[k])}`;
if (properties[k].transition) {
const propertyTransition = ` ${indent}"${k}-transition"?: TransitionSpecification`;
return [property, propertyTransition].join(',\n');
} else {
return property;
}
})
.join(',\n')}
${indent}${sealing}}`;
}
Expand Down
Loading

0 comments on commit cd62ed0

Please sign in to comment.