mirror of
https://github.com/status-im/react-native-mapbox-gl.git
synced 2026-08-30 20:41:08 +00:00
87 lines
2.0 KiB
Plaintext
87 lines
2.0 KiB
Plaintext
<%
|
||
const layers = locals.layers;
|
||
-%>
|
||
/* eslint-disable */
|
||
// DO NOT MODIFY
|
||
// THIS FILE IS AUTOGENERATED
|
||
|
||
import PropTypes from 'prop-types';
|
||
|
||
export const StyleTypes = {
|
||
Constant: 'constant',
|
||
Color: 'color',
|
||
Transition: 'transition',
|
||
Translation: 'translation',
|
||
Function: 'function',
|
||
Image: 'image',
|
||
};
|
||
|
||
export const StyleFunctionTypes = {
|
||
Camera: 'camera',
|
||
Source: 'source',
|
||
Composite: 'composite',
|
||
};
|
||
|
||
export const StyleFunctionPropType = PropTypes.shape({
|
||
type: PropTypes.string.isRequired,
|
||
payload: PropTypes.shape({
|
||
fn: PropTypes.string,
|
||
attributeName: PropTypes.string,
|
||
stops: PropTypes.object,
|
||
mode: PropTypes.any,
|
||
}).isRequired,
|
||
});
|
||
|
||
export const TransitionPropType = PropTypes.shape({
|
||
duration: PropTypes.number,
|
||
delay: PropTypes.number,
|
||
});
|
||
|
||
export const TranslationPropType = PropTypes.shape({
|
||
x: PropTypes.number.isRequired,
|
||
y: PropTypes.number.isRequired,
|
||
});
|
||
|
||
<%_ for (let layer of layers) { _%>
|
||
export const <%- pascelCase(layer.name) _%>LayerStyleProp = PropTypes.shape({
|
||
<%_ for (let prop of layer.properties) { %>
|
||
/**
|
||
* <%- prop.doc.description %>
|
||
<%_ if (prop.doc.requires.length) { _%>
|
||
*
|
||
* @requires <%- prop.doc.requires.join(', ') %>
|
||
<%_ } _%>
|
||
<%_ if (prop.doc.disabledBy.length) { _%>
|
||
*
|
||
* @disabledBy <%- prop.doc.disabledBy.join(', ') %>
|
||
<%_ } _%>
|
||
*/
|
||
<%= prop.name %>: <%- jsDocReactProp(prop) %>,
|
||
<%_ if (prop.transition) { %>
|
||
/**
|
||
* The transition affecting any changes to this layer’s <%= prop.name %> property.
|
||
*/
|
||
<%= prop.name %>Transition: TransitionPropType,
|
||
<%_ } _%>
|
||
<%_ } _%>
|
||
});
|
||
|
||
<%_ } _%>
|
||
|
||
const styleMap = {
|
||
<%_ for (let layer of layers) { _%>
|
||
<%_ for (let prop of layer.properties) { _%>
|
||
<%_ if (prop.name !== 'visibility') { _%>
|
||
<%= prop.name %>: <%- jsStyleType(prop) %>,
|
||
<%_ if (prop.transition) { _%>
|
||
<%= prop.name %>Transition: StyleTypes.Transition,
|
||
<%_ } _%>
|
||
<%_ } _%>
|
||
<%_ } _%>
|
||
|
||
<%_ } _%>
|
||
visibility: StyleTypes.Constant,
|
||
};
|
||
|
||
export default styleMap;
|