refactor: move props.ts from src/types/ to src/core/
The types/ directory now only had a single file. The PropDef and PropTypesFromTable types are foundational to the module infrastructure (used by utils.ts, with-props.ts, and every component), so core/ is a better home. Deleted the empty types/ directory.
This commit is contained in:
parent
565b79a89c
commit
5d0d15fba1
@ -4,7 +4,7 @@ import { withProps } from '../core/with-props.js';
|
|||||||
|
|
||||||
import { registerChildren, unregisterChildren } from '../core/register.js';
|
import { registerChildren, unregisterChildren } from '../core/register.js';
|
||||||
import { isPathStyleAttr, updatePathStyle } from '../core/path-style.js';
|
import { isPathStyleAttr, updatePathStyle } from '../core/path-style.js';
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
lat: { kind: 'num', attr: 'lat', default: 0 },
|
lat: { kind: 'num', attr: 'lat', default: 0 },
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { withProps } from '../core/with-props.js';
|
|||||||
|
|
||||||
import { registerChildren, unregisterChildren } from '../core/register.js';
|
import { registerChildren, unregisterChildren } from '../core/register.js';
|
||||||
import { isPathStyleAttr, updatePathStyle } from '../core/path-style.js';
|
import { isPathStyleAttr, updatePathStyle } from '../core/path-style.js';
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
lat: { kind: 'num', attr: 'lat', default: 0 },
|
lat: { kind: 'num', attr: 'lat', default: 0 },
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { Control, ControlPosition } from 'leaflet';
|
|||||||
import { registerWithParent } from '../core/utils.js';
|
import { registerWithParent } from '../core/utils.js';
|
||||||
import { withProps } from '../core/with-props.js';
|
import { withProps } from '../core/with-props.js';
|
||||||
|
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
position: { kind: 'str', attr: 'position', default: 'bottomright' },
|
position: { kind: 'str', attr: 'position', default: 'bottomright' },
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { Control, ControlPosition } from 'leaflet';
|
|||||||
import { registerWithParent } from '../core/utils.js';
|
import { registerWithParent } from '../core/utils.js';
|
||||||
import { withProps } from '../core/with-props.js';
|
import { withProps } from '../core/with-props.js';
|
||||||
|
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
position: { kind: 'str', attr: 'position', default: 'bottomleft' },
|
position: { kind: 'str', attr: 'position', default: 'bottomleft' },
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { Control, ControlPosition } from 'leaflet';
|
|||||||
import { registerWithParent } from '../core/utils.js';
|
import { registerWithParent } from '../core/utils.js';
|
||||||
import { withProps } from '../core/with-props.js';
|
import { withProps } from '../core/with-props.js';
|
||||||
|
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
position: { kind: 'str', attr: 'position', default: 'topleft' },
|
position: { kind: 'str', attr: 'position', default: 'topleft' },
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { buildOptions } from '../core/utils.js';
|
|||||||
import { withProps } from '../core/with-props.js';
|
import { withProps } from '../core/with-props.js';
|
||||||
|
|
||||||
import { registerChildren, unregisterChildren, getChildren } from '../core/register.js';
|
import { registerChildren, unregisterChildren, getChildren } from '../core/register.js';
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
data: { kind: 'str', attr: 'data', default: '' },
|
data: { kind: 'str', attr: 'data', default: '' },
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { buildOptions, buildAttrMap, setLayerAttr, parseBoundsAttr } from '../co
|
|||||||
import { withProps } from '../core/with-props.js';
|
import { withProps } from '../core/with-props.js';
|
||||||
|
|
||||||
import { registerChildren, unregisterChildren } from '../core/register.js';
|
import { registerChildren, unregisterChildren } from '../core/register.js';
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
url: { kind: 'str', attr: 'url', default: '' },
|
url: { kind: 'str', attr: 'url', default: '' },
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { buildOptions, numAttr, buildAttrMap, setLayerAttr } from '../core/utils
|
|||||||
import { withProps } from '../core/with-props.js';
|
import { withProps } from '../core/with-props.js';
|
||||||
|
|
||||||
import { registerChildren, unregisterChildren } from '../core/register.js';
|
import { registerChildren, unregisterChildren } from '../core/register.js';
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
lat: { kind: 'num', attr: 'lat', default: 0 },
|
lat: { kind: 'num', attr: 'lat', default: 0 },
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { withProps } from '../core/with-props.js';
|
|||||||
|
|
||||||
import { registerChildren, unregisterChildren } from '../core/register.js';
|
import { registerChildren, unregisterChildren } from '../core/register.js';
|
||||||
import { isPathStyleAttr, updatePathStyle } from '../core/path-style.js';
|
import { isPathStyleAttr, updatePathStyle } from '../core/path-style.js';
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
import type { LeafletLine } from './leaflet-line.js';
|
import type { LeafletLine } from './leaflet-line.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { withProps } from '../core/with-props.js';
|
|||||||
|
|
||||||
import { registerChildren, unregisterChildren } from '../core/register.js';
|
import { registerChildren, unregisterChildren } from '../core/register.js';
|
||||||
import { isPathStyleAttr, updatePathStyle } from '../core/path-style.js';
|
import { isPathStyleAttr, updatePathStyle } from '../core/path-style.js';
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
import type { LeafletLine } from './leaflet-line.js';
|
import type { LeafletLine } from './leaflet-line.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { Popup } from 'leaflet';
|
|||||||
import { registerWithParent, buildOptions, numAttr } from '../core/utils.js';
|
import { registerWithParent, buildOptions, numAttr } from '../core/utils.js';
|
||||||
import { withProps } from '../core/with-props.js';
|
import { withProps } from '../core/with-props.js';
|
||||||
|
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
lat: { kind: 'num', attr: 'lat', default: 0 },
|
lat: { kind: 'num', attr: 'lat', default: 0 },
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { withProps } from '../core/with-props.js';
|
|||||||
|
|
||||||
import { registerChildren, unregisterChildren } from '../core/register.js';
|
import { registerChildren, unregisterChildren } from '../core/register.js';
|
||||||
import { isPathStyleAttr, updatePathStyle } from '../core/path-style.js';
|
import { isPathStyleAttr, updatePathStyle } from '../core/path-style.js';
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
bounds: { kind: 'str', attr: 'bounds', default: '' },
|
bounds: { kind: 'str', attr: 'bounds', default: '' },
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { buildOptions, buildAttrMap, setLayerAttr, parseBoundsAttr } from '../co
|
|||||||
import { withProps } from '../core/with-props.js';
|
import { withProps } from '../core/with-props.js';
|
||||||
|
|
||||||
import { registerChildren, unregisterChildren } from '../core/register.js';
|
import { registerChildren, unregisterChildren } from '../core/register.js';
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
bounds: { kind: 'str', attr: 'bounds', default: '' },
|
bounds: { kind: 'str', attr: 'bounds', default: '' },
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { buildOptions, buildAttrMap, setLayerAttr, parseAttributeValue } from '.
|
|||||||
import { withProps } from '../core/with-props.js';
|
import { withProps } from '../core/with-props.js';
|
||||||
|
|
||||||
import { registerChildren, unregisterChildren } from '../core/register.js';
|
import { registerChildren, unregisterChildren } from '../core/register.js';
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
url: { kind: 'str', attr: 'url', default: '' },
|
url: { kind: 'str', attr: 'url', default: '' },
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { buildOptions, buildAttrMap, setLayerAttr } from '../core/utils.js';
|
|||||||
import { withProps } from '../core/with-props.js';
|
import { withProps } from '../core/with-props.js';
|
||||||
|
|
||||||
import { registerChildren, unregisterChildren } from '../core/register.js';
|
import { registerChildren, unregisterChildren } from '../core/register.js';
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
url: { kind: 'str', attr: 'url', default: '' },
|
url: { kind: 'str', attr: 'url', default: '' },
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import type { TooltipOptions } from 'leaflet';
|
|||||||
import { registerWithParent, buildOptions, numAttr } from '../core/utils.js';
|
import { registerWithParent, buildOptions, numAttr } from '../core/utils.js';
|
||||||
import { withProps } from '../core/with-props.js';
|
import { withProps } from '../core/with-props.js';
|
||||||
|
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
lat: { kind: 'num', attr: 'lat', default: 0 },
|
lat: { kind: 'num', attr: 'lat', default: 0 },
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { buildOptions, buildAttrMap, setLayerAttr, parseBoundsAttr } from '../co
|
|||||||
import { withProps } from '../core/with-props.js';
|
import { withProps } from '../core/with-props.js';
|
||||||
|
|
||||||
import { registerChildren, unregisterChildren } from '../core/register.js';
|
import { registerChildren, unregisterChildren } from '../core/register.js';
|
||||||
import type { PropDef } from '../types/props.js';
|
import type { PropDef } from '../core/props.js';
|
||||||
|
|
||||||
const PROPS = {
|
const PROPS = {
|
||||||
url: { kind: 'str', attr: 'url', default: '' },
|
url: { kind: 'str', attr: 'url', default: '' },
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import type { PropDef, PropTypesFromTable } from '../types/props.js';
|
import type { PropDef, PropTypesFromTable } from './props.js';
|
||||||
import type { LatLngBoundsExpression } from 'leaflet';
|
import type { LatLngBoundsExpression } from 'leaflet';
|
||||||
|
|
||||||
// Parses an HTML attribute string into a typed JS value:
|
// Parses an HTML attribute string into a typed JS value:
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import type { PropDef, PropTypesFromTable } from '../types/props.js';
|
import type { PropDef, PropTypesFromTable } from './props.js';
|
||||||
import { definePropAccessors } from './utils.js';
|
import { definePropAccessors } from './utils.js';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
|||||||
@ -2,7 +2,7 @@ export * from './core/utils.js';
|
|||||||
export * from './core/with-props.js';
|
export * from './core/with-props.js';
|
||||||
export * from './core/path-style.js';
|
export * from './core/path-style.js';
|
||||||
export * from './core/register.js';
|
export * from './core/register.js';
|
||||||
export * from './types/props.js';
|
export * from './core/props.js';
|
||||||
export * from './components/leaflet-map.js';
|
export * from './components/leaflet-map.js';
|
||||||
export * from './components/leaflet-marker.js';
|
export * from './components/leaflet-marker.js';
|
||||||
export * from './components/leaflet-circle.js';
|
export * from './components/leaflet-circle.js';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user