Skip to content

Commit

Permalink
refactor: drop Props suffix on style types
Browse files Browse the repository at this point in the history
  • Loading branch information
KiwiKilian committed Dec 15, 2024
1 parent e001336 commit c5e946b
Show file tree
Hide file tree
Showing 26 changed files with 78 additions and 78 deletions.
2 changes: 1 addition & 1 deletion docs/components/BackgroundLayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
## Props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| style | `BackgroundLayerStyleProps` | `none` | `false` | Customizable style attributes |
| style | `BackgroundLayerStyle` | `none` | `false` | Customizable style attributes |
| sourceID | `FIX ME UNKNOWN TYPE` | `MapLibreRN.StyleSource.DefaultSourceID` | `false` | FIX ME NO DESCRIPTION |


Expand Down
2 changes: 1 addition & 1 deletion docs/components/CircleLayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CircleLayer is a style layer that renders one or more filled circles on the map.
## Props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| style | `CircleLayerStyleProps` | `none` | `false` | Customizable style attributes |
| style | `CircleLayerStyle` | `none` | `false` | Customizable style attributes |
| sourceID | `FIX ME UNKNOWN TYPE` | `MapLibreRN.StyleSource.DefaultSourceID` | `false` | FIX ME NO DESCRIPTION |


Expand Down
2 changes: 1 addition & 1 deletion docs/components/FillExtrusionLayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FillExtrusionLayer is a style layer that renders one or more 3D extruded polygon
## Props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| style | `FillExtrusionLayerStyleProps` | `none` | `false` | Customizable style attributes |
| style | `FillExtrusionLayerStyle` | `none` | `false` | Customizable style attributes |
| sourceID | `FIX ME UNKNOWN TYPE` | `MapLibreRN.StyleSource.DefaultSourceID` | `false` | FIX ME NO DESCRIPTION |


Expand Down
2 changes: 1 addition & 1 deletion docs/components/FillLayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FillLayer is a style layer that renders one or more filled (and optionally strok
## Props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| style | `FillLayerStyleProps` | `none` | `false` | Customizable style attributes |
| style | `FillLayerStyle` | `none` | `false` | Customizable style attributes |
| sourceID | `FIX ME UNKNOWN TYPE` | `MapLibreRN.StyleSource.DefaultSourceID` | `false` | FIX ME NO DESCRIPTION |


Expand Down
2 changes: 1 addition & 1 deletion docs/components/HeatmapLayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ HeatmapLayer is a style layer that renders one or more filled circles on the map
## Props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| style | `HeatmapLayerStyleProps` | `none` | `false` | Customizable style attributes |
| style | `HeatmapLayerStyle` | `none` | `false` | Customizable style attributes |
| sourceID | `FIX ME UNKNOWN TYPE` | `MapLibreRN.StyleSource.DefaultSourceID` | `false` | FIX ME NO DESCRIPTION |


Expand Down
2 changes: 1 addition & 1 deletion docs/components/Light.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Light represents the light source for extruded geometries
## Props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| style | `LightLayerStyleProps` | `none` | `false` | Customizable style attributes |
| style | `LightLayerStyle` | `none` | `false` | Customizable style attributes |


## Styles
Expand Down
2 changes: 1 addition & 1 deletion docs/components/LineLayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LineLayer is a style layer that renders one or more stroked polylines on the map
## Props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| style | `LineLayerStyleProps` | `none` | `false` | Customizable style attributes |
| style | `LineLayerStyle` | `none` | `false` | Customizable style attributes |
| sourceID | `FIX ME UNKNOWN TYPE` | `MapLibreRN.StyleSource.DefaultSourceID` | `false` | FIX ME NO DESCRIPTION |


Expand Down
2 changes: 1 addition & 1 deletion docs/components/RasterLayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
## Props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| style | `RasterLayerStyleProps` | `none` | `false` | Customizable style attributes |
| style | `RasterLayerStyle` | `none` | `false` | Customizable style attributes |
| sourceID | `FIX ME UNKNOWN TYPE` | `MapLibreRN.StyleSource.DefaultSourceID` | `false` | FIX ME NO DESCRIPTION |


Expand Down
2 changes: 1 addition & 1 deletion docs/components/SymbolLayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SymbolLayer is a style layer that renders icon and text labels at points or alon
## Props
| Prop | Type | Default | Required | Description |
| ---- | :--: | :-----: | :------: | :----------: |
| style | `SymbolLayerStyleProps` | `none` | `false` | Customizable style attributes |
| style | `SymbolLayerStyle` | `none` | `false` | Customizable style attributes |
| sourceID | `FIX ME UNKNOWN TYPE` | `MapLibreRN.StyleSource.DefaultSourceID` | `false` | FIX ME NO DESCRIPTION |


Expand Down
18 changes: 9 additions & 9 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
{
"name": "style",
"required": false,
"type": "BackgroundLayerStyleProps",
"type": "BackgroundLayerStyle",
"default": "none",
"description": "Customizable style attributes"
},
Expand Down Expand Up @@ -562,7 +562,7 @@
{
"name": "style",
"required": false,
"type": "CircleLayerStyleProps",
"type": "CircleLayerStyle",
"default": "none",
"description": "Customizable style attributes"
},
Expand Down Expand Up @@ -866,7 +866,7 @@
{
"name": "style",
"required": false,
"type": "FillExtrusionLayerStyleProps",
"type": "FillExtrusionLayerStyle",
"default": "none",
"description": "Customizable style attributes"
},
Expand Down Expand Up @@ -1081,7 +1081,7 @@
{
"name": "style",
"required": false,
"type": "FillLayerStyleProps",
"type": "FillLayerStyle",
"default": "none",
"description": "Customizable style attributes"
},
Expand Down Expand Up @@ -1309,7 +1309,7 @@
{
"name": "style",
"required": false,
"type": "HeatmapLayerStyleProps",
"type": "HeatmapLayerStyle",
"default": "none",
"description": "Customizable style attributes"
},
Expand Down Expand Up @@ -1568,7 +1568,7 @@
{
"name": "style",
"required": false,
"type": "LightLayerStyleProps",
"type": "LightLayerStyle",
"default": "none",
"description": "Customizable style attributes"
}
Expand Down Expand Up @@ -1674,7 +1674,7 @@
{
"name": "style",
"required": false,
"type": "LineLayerStyleProps",
"type": "LineLayerStyle",
"default": "none",
"description": "Customizable style attributes"
},
Expand Down Expand Up @@ -2772,7 +2772,7 @@
{
"name": "style",
"required": false,
"type": "RasterLayerStyleProps",
"type": "RasterLayerStyle",
"default": "none",
"description": "Customizable style attributes"
},
Expand Down Expand Up @@ -3363,7 +3363,7 @@
{
"name": "style",
"required": false,
"type": "SymbolLayerStyleProps",
"type": "SymbolLayerStyle",
"default": "none",
"description": "Customizable style attributes"
},
Expand Down
4 changes: 2 additions & 2 deletions scripts/templates/MapLibreRNStyles.ts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export type Value<T, AllowedParameters extends ExpressionParameters[] = []> =
| Expression;

<%_ for (let layer of layers) { _%>
export interface <%- helpers.pascalCase(layer.name) %>LayerStyleProps {
export interface <%- helpers.pascalCase(layer.name) %>LayerStyle {
<%_ for (let prop of layer.properties) { _%>
/**
* <%- prop.doc.description %>
Expand All @@ -87,4 +87,4 @@ export type Value<T, AllowedParameters extends ExpressionParameters[] = []> =
};
<%_ } _%>

export type AllLayerStyleProps = <%- layers.map(l => `${helpers.pascalCase(l.name)}LayerStyleProps`).join("|") -%>;
export type AllLayerStyle = <%- layers.map(l => `${helpers.pascalCase(l.name)}LayerStyle`).join("|") -%>;
20 changes: 10 additions & 10 deletions src/MapLibreRN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export type { MapLibreRNEvent } from "./types/MapLibreRNEvent";
export { default as Animated } from "./utils/animated/Animated";
export { default as Logger, type LogLevel } from "./utils/Logger";
export type {
FillLayerStyleProps as FillLayerStyle,
LineLayerStyleProps as LineLayerStyle,
SymbolLayerStyleProps as SymbolLayerStyle,
CircleLayerStyleProps as CircleLayerStyle,
HeatmapLayerStyleProps as HeatmapLayerStyle,
FillExtrusionLayerStyleProps as FillExtrusionLayerStyle,
RasterLayerStyleProps as RasterLayerStyle,
HillshadeLayerStyleProps as HillshadeLayerStyle,
BackgroundLayerStyleProps as BackgroundLayerStyle,
LightLayerStyleProps as LightLayerStyle,
FillLayerStyle,
LineLayerStyle,
SymbolLayerStyle,
CircleLayerStyle,
HeatmapLayerStyle,
FillExtrusionLayerStyle,
RasterLayerStyle,
HillshadeLayerStyle,
BackgroundLayerStyle,
LightLayerStyle,
} from "./utils/MapLibreRNStyles";
6 changes: 3 additions & 3 deletions src/components/Annotation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Animated as RNAnimated, Easing } from "react-native";

import SymbolLayer from "./SymbolLayer";
import { type OnPressEvent } from "../types/OnPressEvent";
import { type SymbolLayerStyleProps } from "../utils/MapLibreRNStyles";
import { type SymbolLayerStyle } from "../utils/MapLibreRNStyles";
import { AnimatedShapeSource } from "../utils/animated/Animated";
import AnimatedMapPoint from "../utils/animated/AnimatedPoint";

Expand Down Expand Up @@ -46,7 +46,7 @@ function isShapeAnimated(shape: Shape): shape is AnimatedMapPoint {

interface AnnotationRef {
onPress(event: OnPressEvent): void;
symbolStyle: SymbolLayerStyleProps | undefined;
symbolStyle: SymbolLayerStyle | undefined;
}

const Annotation = forwardRef<AnnotationRef, AnnotationProps>(
Expand Down Expand Up @@ -126,7 +126,7 @@ const Annotation = forwardRef<AnnotationRef, AnnotationProps>(
}

const children = [];
const symbolStyle: SymbolLayerStyleProps | undefined = props.icon
const symbolStyle: SymbolLayerStyle | undefined = props.icon
? {
...props.style,
iconImage: typeof props.icon === "string" ? props.icon : undefined,
Expand Down
4 changes: 2 additions & 2 deletions src/components/BackgroundLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import useAbstractLayer, {
type NativeBaseProps,
} from "../hooks/useAbstractLayer";
import { type BaseProps } from "../types/BaseProps";
import { type BackgroundLayerStyleProps } from "../utils/MapLibreRNStyles";
import { type BackgroundLayerStyle } from "../utils/MapLibreRNStyles";

const MapLibreRN = NativeModules.MLRNModule;

Expand All @@ -16,7 +16,7 @@ export interface BackgroundLayerProps extends BaseProps, BaseLayerProps {
/**
* Customizable style attributes
*/
style?: BackgroundLayerStyleProps;
style?: BackgroundLayerStyle;
}

interface NativeProps
Expand Down
4 changes: 2 additions & 2 deletions src/components/CircleLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import useAbstractLayer, {
type NativeBaseProps,
} from "../hooks/useAbstractLayer";
import { type BaseProps } from "../types/BaseProps";
import { type CircleLayerStyleProps } from "../utils/MapLibreRNStyles";
import { type CircleLayerStyle } from "../utils/MapLibreRNStyles";

const MapLibreRN = NativeModules.MLRNModule;

Expand All @@ -16,7 +16,7 @@ export interface CircleLayerProps extends BaseProps, BaseLayerProps {
/**
* Customizable style attributes
*/
style?: CircleLayerStyleProps;
style?: CircleLayerStyle;
}

interface NativeProps
Expand Down
4 changes: 2 additions & 2 deletions src/components/FillExtrusionLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import useAbstractLayer, {
type NativeBaseProps,
} from "../hooks/useAbstractLayer";
import { type BaseProps } from "../types/BaseProps";
import { type FillExtrusionLayerStyleProps } from "../utils/MapLibreRNStyles";
import { type FillExtrusionLayerStyle } from "../utils/MapLibreRNStyles";

const MapLibreRN = NativeModules.MLRNModule;

Expand All @@ -16,7 +16,7 @@ export interface FillExtrusionLayerProps extends BaseProps, BaseLayerProps {
/**
* Customizable style attributes
*/
style?: FillExtrusionLayerStyleProps;
style?: FillExtrusionLayerStyle;
}

interface NativeProps
Expand Down
4 changes: 2 additions & 2 deletions src/components/FillLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import useAbstractLayer, {
type NativeBaseProps,
} from "../hooks/useAbstractLayer";
import { type BaseProps } from "../types/BaseProps";
import { type FillLayerStyleProps } from "../utils/MapLibreRNStyles";
import { type FillLayerStyle } from "../utils/MapLibreRNStyles";

const MapLibreRN = NativeModules.MLRNModule;

Expand All @@ -16,7 +16,7 @@ export interface FillLayerProps extends BaseProps, BaseLayerProps {
/**
* Customizable style attributes
*/
style?: FillLayerStyleProps;
style?: FillLayerStyle;
}

interface NativeProps extends Omit<FillLayerProps, "style">, NativeBaseProps {}
Expand Down
4 changes: 2 additions & 2 deletions src/components/HeatmapLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import useAbstractLayer, {
type NativeBaseProps,
} from "../hooks/useAbstractLayer";
import { type BaseProps } from "../types/BaseProps";
import { type HeatmapLayerStyleProps } from "../utils/MapLibreRNStyles";
import { type HeatmapLayerStyle } from "../utils/MapLibreRNStyles";

const MapLibreRN = NativeModules.MLRNModule;

Expand All @@ -16,7 +16,7 @@ export interface HeatmapLayerProps extends BaseProps, BaseLayerProps {
/**
* Customizable style attributes
*/
style?: HeatmapLayerStyleProps;
style?: HeatmapLayerStyle;
}

interface NativeProps
Expand Down
4 changes: 2 additions & 2 deletions src/components/Light.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useAbstractLayer, {
type BaseLayerProps,
} from "../hooks/useAbstractLayer";
import { type BaseProps } from "../types/BaseProps";
import { type LightLayerStyleProps } from "../utils/MapLibreRNStyles";
import { type LightLayerStyle } from "../utils/MapLibreRNStyles";
import { type StyleValue } from "../utils/StyleValue";

export const NATIVE_MODULE_NAME = "MLRNLight";
Expand All @@ -14,7 +14,7 @@ interface LightProps extends BaseProps, BaseLayerProps {
/**
* Customizable style attributes
*/
style?: LightLayerStyleProps;
style?: LightLayerStyle;
}

interface NativeProps extends Omit<LightProps, "style"> {
Expand Down
4 changes: 2 additions & 2 deletions src/components/LineLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import useAbstractLayer, {
type NativeBaseProps,
} from "../hooks/useAbstractLayer";
import { type BaseProps } from "../types/BaseProps";
import { type LineLayerStyleProps } from "../utils/MapLibreRNStyles";
import { type LineLayerStyle } from "../utils/MapLibreRNStyles";

const MapLibreRN = NativeModules.MLRNModule;

Expand All @@ -16,7 +16,7 @@ export interface LineLayerProps extends BaseProps, BaseLayerProps {
/**
* Customizable style attributes
*/
style?: LineLayerStyleProps;
style?: LineLayerStyle;
}

interface NativeProps extends Omit<LineLayerProps, "style">, NativeBaseProps {}
Expand Down
4 changes: 2 additions & 2 deletions src/components/RasterLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import useAbstractLayer, {
type NativeBaseProps,
} from "../hooks/useAbstractLayer";
import { type BaseProps } from "../types/BaseProps";
import { type RasterLayerStyleProps } from "../utils/MapLibreRNStyles";
import { type RasterLayerStyle } from "../utils/MapLibreRNStyles";

const MapLibreRN = NativeModules.MLRNModule;

Expand All @@ -16,7 +16,7 @@ export interface RasterLayerProps extends BaseProps, BaseLayerProps {
/**
* Customizable style attributes
*/
style?: RasterLayerStyleProps;
style?: RasterLayerStyle;
}

interface NativeProps
Expand Down
4 changes: 2 additions & 2 deletions src/components/SymbolLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useAbstractLayer, {
type NativeBaseProps,
} from "../hooks/useAbstractLayer";
import { type BaseProps } from "../types/BaseProps";
import { type SymbolLayerStyleProps } from "../utils/MapLibreRNStyles";
import { type SymbolLayerStyle } from "../utils/MapLibreRNStyles";

const MapLibreRN = NativeModules.MLRNModule;

Expand All @@ -15,7 +15,7 @@ export interface SymbolLayerProps extends BaseProps, BaseLayerProps {
/**
* Customizable style attributes
*/
style?: SymbolLayerStyleProps;
style?: SymbolLayerStyle;
}

interface NativeProps
Expand Down
Loading

0 comments on commit c5e946b

Please sign in to comment.