Skip to content

Commit

Permalink
remove private and public declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhenn committed Aug 7, 2024
1 parent 15f606d commit 7ff4520
Show file tree
Hide file tree
Showing 39 changed files with 196 additions and 195 deletions.
4 changes: 2 additions & 2 deletions src/geo/CRS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import type { WithNull } from '../types/typings';
* @category geo
*/
class CRS {
public type: string;
public properties: any;
type: string;
properties: any;

/**
* @param type type of the CRS
Expand Down
6 changes: 3 additions & 3 deletions src/geo/Position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export type PositionLike = Point | Coordinate | PositionJson<NumberAble> | Point
* @category basic types
*/
abstract class Position {
public x: number;
public y: number;
public z: WithUndef<number>;
x: number;
y: number;
z: WithUndef<number>;

constructor(x: PositionLike)
constructor(x: PositionArray<NumberAble>)
Expand Down
4 changes: 2 additions & 2 deletions src/geo/Size.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export type SizeLike = Size | JsonSize;
* ```
*/
class Size {
public width: number;
public height: number;
width: number;
height: number;

/**
* @param width - width value
Expand Down
2 changes: 1 addition & 1 deletion src/geo/measurer/Sphere.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type CoordsLike = Coordinate | CoordinateJson;
* @private
*/
class Sphere {
public radius: number;
radius: number;

/**
* @param radius Sphere's radius
Expand Down
2 changes: 1 addition & 1 deletion src/geo/transformation/Transformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Point from '../Point';
* @protected
*/
class Transformation {
public matrix: number[];
matrix: number[];

/**
* The base 2d point system is a fixed system that is consistent with HTML coordinate system: on X-Axis, left is smaller and right is larger; on Y-Axis, top is smaller and bottom is larger. <br>
Expand Down
6 changes: 3 additions & 3 deletions src/geometry/CenterMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import type { Map } from '../map';
*/
export default function <T extends MixinConstructor>(Base: T) {
return class extends Base {
public _coordinates: Coordinate
public _pcenter: Coordinate
public _dirtyCoords: boolean
_coordinates: Coordinate
_pcenter: Coordinate
_dirtyCoords: boolean
getMap?(): Map
_getProjection?(): CommonProjectionType
onPositionChanged?(): void
Expand Down
2 changes: 1 addition & 1 deletion src/geometry/Circle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const options: CircleOptionsType = {
* @mixes CenterMixin
*/
export class Circle extends CenterMixin(Polygon) {
public _radius: number
_radius: number

static fromJSON(json: Record<string, any>): Circle {
const feature = json['feature'];
Expand Down
4 changes: 2 additions & 2 deletions src/geometry/Ellipse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ const options: EllipseOptionsType = {
* });
*/
export class Ellipse extends CenterMixin(Polygon) {
public width: number
public height: number
width: number
height: number
options: EllipseOptionsType;

static fromJSON(json: Record<string, any>): Ellipse {
Expand Down
76 changes: 38 additions & 38 deletions src/geometry/Geometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,48 +92,48 @@ const options: GeometryOptionsType = {
*/
export class Geometry extends JSONAble(Eventable(Handlerable(Class))) {
options: GeometryOptionsType;
public type: string;
public _layer: OverlayLayer;
public _angle: number
public _pivot: Coordinate
public _id: string
public properties: Record<string, any>;
public _symbol: any
public _symbolUpdated: any
public _compiledSymbol: any
public _symbolHash: any
public _textDesc: any
public _eventSymbolProperties: any
public _sizeSymbol: any
public _internalId: number
public _extent: Extent
public _fixedExtent: PointExtent
public _extent2d: PointExtent
public _externSymbol: any
public _parent: Geometry | GeometryCollection
public _silence: boolean
public _projCode: string
public _painter: Painter
public _maskPainter: CollectionPainter | Painter
public _dirtyCoords: any
public _pcenter: Coordinate
public _coordinates: any;
public _infoWinOptions: InfoWindowOptionsType;
public _minAlt: number
public _maxAlt: number;
type: string;
_layer: OverlayLayer;
_angle: number
_pivot: Coordinate
_id: string
properties: Record<string, any>;
_symbol: any
_symbolUpdated: any
_compiledSymbol: any
_symbolHash: any
_textDesc: any
_eventSymbolProperties: any
_sizeSymbol: any
_internalId: number
_extent: Extent
_fixedExtent: PointExtent
_extent2d: PointExtent
_externSymbol: any
_parent: Geometry | GeometryCollection
_silence: boolean
_projCode: string
_painter: Painter
_maskPainter: CollectionPainter | Painter
_dirtyCoords: any
_pcenter: Coordinate
_coordinates: any;
_infoWinOptions: InfoWindowOptionsType;
_minAlt: number
_maxAlt: number;
// 在 VectorLayerCanvasRenderer 附加的信息
public _isCheck?: boolean;
public _cPoint?: any;
public _inCurrentView?: boolean;
_isCheck?: boolean;
_cPoint?: any;
_inCurrentView?: boolean;
// 在 Marker 中附加的信息,Marker 和其子类都具有此属性
public isPoint?: boolean;
private _savedVisible?: boolean;
isPoint?: boolean;
_savedVisible?: boolean;
//
public _paintAsPath?: () => any;
public _getPaintParams?: (disableSimplify?: boolean) => any[];
public _simplified?: boolean;
_paintAsPath?: () => any;
_getPaintParams?: (disableSimplify?: boolean) => any[];
_simplified?: boolean;
// 本身应该存于 Path 类,但是由于渲染层需要大量的特殊熟悉判断,定义在这里回减少很多麻烦
public getHoles?(): Array<Array<Coordinate>>;
getHoles?(): Array<Array<Coordinate>>;
__connectors: Array<Geometry>;
getShell?(): Array<Coordinate>;
getGeometries?(): Geometry[];
Expand Down
10 changes: 5 additions & 5 deletions src/geometry/GeometryCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ const TEMP_EXTENT = new PointExtent();
*/
class GeometryCollection extends Geometry {

public _geometries: Geometry[]
public _pickGeometryIndex: number
public _originalSymbol: any
public _draggbleBeforeEdit: any
public _editing: boolean
_geometries: Geometry[]
_pickGeometryIndex: number
_originalSymbol: any
_draggbleBeforeEdit: any
_editing: boolean

/**
* @param {Geometry[]} geometries - GeometryCollection's geometries
Expand Down
2 changes: 1 addition & 1 deletion src/geometry/Label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const options: LabelOptionsType = {
*/
class Label extends TextMarker {

public options: any
options: any

/**
* @param {String} content - Label's text content
Expand Down
2 changes: 1 addition & 1 deletion src/geometry/Marker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const options: MarkerOptionsType = {
* });
*/
export class Marker extends CenterMixin(Geometry) {
public isPoint: boolean
isPoint: boolean
/**
* @param {Coordinate} coordinates - coordinates of the marker
* @param {Object} [options=null] - construct options defined in [Marker]{@link Marker#options}
Expand Down
2 changes: 1 addition & 1 deletion src/geometry/MultiGeometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type GeometryClass<T> = (new (coordinates: SingleGeometryCreateCoordinates, opti


class MultiGeometry extends GeometryCollection {
public GeometryType: GeometryClass<Geometry>;
GeometryType: GeometryClass<Geometry>;

/**
* @param {Class} geoType Type of the geometry
Expand Down
20 changes: 10 additions & 10 deletions src/geometry/Path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ export type MultiPathsCoordinates = Array<PathsCoordinates>;
export class Path extends Geometry {

_coordinates: Coordinate[];
public _showPlayer: Player;
public _animIdx: number
public _animLenSoFar: number
public _animTailRatio: number
public _prjAniShowCenter: Coordinate
public _aniShowCenter: Coordinate
public _tempCoord: Coordinate
public _tempPrjCoord: Point
public _simplified: boolean
public _prjCoords: Array<Coordinate>
_showPlayer: Player;
_animIdx: number
_animLenSoFar: number
_animTailRatio: number
_prjAniShowCenter: Coordinate
_aniShowCenter: Coordinate
_tempCoord: Coordinate
_tempPrjCoord: Point
_simplified: boolean
_prjCoords: Array<Coordinate>
hasHoles?(): boolean;
_getPrjHoles?(): Array<Array<Coordinate>>;

Expand Down
6 changes: 3 additions & 3 deletions src/geometry/Polygon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export type RingsCoordinates = PathsCoordinates;

export class Polygon extends Path {

public _holes: RingsCoordinates;
public _prjHoles: RingsCoordinates;
public _prjShell: RingCoordinates;
_holes: RingsCoordinates;
_prjHoles: RingsCoordinates;
_prjShell: RingCoordinates;
_getShell?(): RingCoordinates;
/**
* @param {Number[][]|Number[][][]|Coordinate[]|Coordinate[][]} coordinates - coordinates, shell coordinates or all the rings.
Expand Down
6 changes: 3 additions & 3 deletions src/geometry/Rectangle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import Polygon, { PolygonOptionsType, RingCoordinates, RingsCoordinates } from '
export class Rectangle extends Polygon {
// @ts-expect-error 确实需要重写父类的属性
_coordinates: Coordinate;
public _width: number
public _height: number
public _pnw: any
_width: number
_height: number
_pnw: any

static fromJSON(json): Rectangle {
const feature = json['feature'];
Expand Down
4 changes: 2 additions & 2 deletions src/geometry/Sector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const options = {
* });
*/
export class Sector extends Circle {
public startAngle: number
public endAngle: number
startAngle: number
endAngle: number

static fromJSON(json: Record<string, any>): Sector {
const feature = json['feature'];
Expand Down
8 changes: 4 additions & 4 deletions src/geometry/TextBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ const options: TextBoxOptionsType = {
class TextBox extends TextMarker {

options: TextBoxOptionsType;
public _width: number
public _height: number
public _oldWidth: any
public _oldHeight: any
_width: number
_height: number
_oldWidth: any
_oldHeight: any
/**
* @param {String} content - TextBox's text content
* @param {Coordinate} coordinates - coordinates
Expand Down
4 changes: 2 additions & 2 deletions src/geometry/TextMarker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const defaultBoxSymbol: VectorMarkerSymbol = {
* @extends Marker
*/
class TextMarker extends Marker {
public _content: string
public _refreshing: boolean
_content: string
_refreshing: boolean
_refresh?(): void
getTextStyle?(): any
setTextStyle?(tyle?: any): any
Expand Down
22 changes: 11 additions & 11 deletions src/geometry/editor/GeometryEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ const options: GeometryEditOptionsType = {
*/
class GeometryEditor extends Eventable(Class) {

public _geometry: any;
private _originalSymbol: any
private _shadowLayer: any
private _shadow: any
private _geometryDraggble: boolean
private _history: any
private _historyPointer: any
private _editOutline: any
private _refreshHooks: Array<any>
private _updating: boolean
public editing: boolean;
_geometry: any;
_originalSymbol: any
_shadowLayer: any
_shadow: any
_geometryDraggble: boolean
_history: any
_historyPointer: any
_editOutline: any
_refreshHooks: Array<any>
_updating: boolean
editing: boolean;
options: GeometryEditOptionsType;

/**
Expand Down
22 changes: 11 additions & 11 deletions src/geometry/ext/Geometry.Drag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ const EVENTS = Browser.touch ? 'touchstart mousedown' : 'mousedown';
*/
class GeometryDragHandler extends Handler {

public container: any

private _dragHandler: any
private _shadow: any
private _dragStageLayer: any
private _shadowConnectors: any
private _lastCoord: any
private _lastPoint: any
private _startParam: any
private _moved: boolean
private _isDragging: boolean
container: any

_dragHandler: any
_shadow: any
_dragStageLayer: any
_shadowConnectors: any
_lastCoord: any
_lastPoint: any
_startParam: any
_moved: boolean
_isDragging: boolean


/**
Expand Down
2 changes: 1 addition & 1 deletion src/layer/tile/GroupTileLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function checkLayers(tileLayers: TileLayer[] | TileLayer): TileLayer[] {
class GroupTileLayer extends TileLayer {
layers: TileLayer[];
layerMap: Record<string, TileLayer>;
private _groupChildren: any[];
_groupChildren: any[];
/**
* Reproduce a GroupTileLayer from layer's profile JSON.
* @param layerJSON - layer's profile JSON
Expand Down
Loading

0 comments on commit 7ff4520

Please sign in to comment.