Skip to content

Commit

Permalink
0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Apr 2, 2022
1 parent ad3c49f commit be4e3e3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 34 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cobe",
"version": "0.4.2",
"version": "0.5.0",
"type": "module",
"main": "./dist/index.esm.js",
"files": [
Expand All @@ -11,7 +11,7 @@
"license": "MIT",
"scripts": {
"build:esm": "node scripts/build.js && cp src/index.d.ts dist/index.d.ts",
"build": "yarn build:esm"
"build": "pnpm build:esm"
},
"dependencies": {
"phenomenon": "^1.6.0"
Expand Down
52 changes: 20 additions & 32 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,30 @@
import Phenomenon from "phenomenon";

declare namespace OptionKey {
const OPT_PHI = "phi";
const OPT_THETA = "theta";
const OPT_DOTS = "mapSamples";
const OPT_MAP_BRIGHTNESS = "mapBrightness";
const OPT_BASE_COLOR = "baseColor";
const OPT_MARKER_COLOR = "markerColor";
const OPT_GLOW_COLOR = "glowColor";
const OPT_MARKERS = "markers";
const OPT_DIFFUSE = "diffuse";
const OPT_DPR = "devicePixelRatio";
const OPT_DARK = "dark";
}
import Phenomenon from 'phenomenon'

export interface Marker {
location: [number, number];
size: number;
location: [number, number]
size: number
}

export interface COBEOptions {
width: number;
height: number;
onRender: (state: Record<string, any>) => void;
[OptionKey.OPT_PHI]: number;
[OptionKey.OPT_THETA]: number;
[OptionKey.OPT_DOTS]: number;
[OptionKey.OPT_MAP_BRIGHTNESS]: number;
[OptionKey.OPT_BASE_COLOR]: [number, number, number];
[OptionKey.OPT_MARKER_COLOR]: [number, number, number];
[OptionKey.OPT_GLOW_COLOR]: [number, number, number];
[OptionKey.OPT_MARKERS]: Marker[];
[OptionKey.OPT_DIFFUSE]: number;
[OptionKey.OPT_DPR]: number;
[OptionKey.OPT_DARK]: number;
width: number
height: number
onRender: (state: Record<string, any>) => void
phi: number
theta: number
mapSamples: number
mapBrightness: number
baseColor: [number, number, number]
markerColor: [number, number, number]
glowColor: [number, number, number]
markers: Marker[]
diffuse: number
devicePixelRatio: number
dark: number
offset?: [number, number]
scale?: number
}

export default function createGlobe(
canvas: HTMLCanvasElement,
opts: COBEOptions
): Phenomenon;
): Phenomenon

0 comments on commit be4e3e3

Please sign in to comment.