Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"vite-plugin-html": "^3.2.2"
},
"dependencies": {
"@fxhash/project-sdk": "0.0.13",
"@thi.ng/canvas": "^0.1.1",
"@thi.ng/date": "^2.5.8",
"@thi.ng/dl-asset": "^2.3.54",
Expand Down
33 changes: 0 additions & 33 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,36 +116,3 @@ export interface State extends BaseState {
*/
canvas: CanvasContext;
}


/**
* Some useful variables and function from the @fxhash/project-sdk
* Will be exposed in window.$fx
*
* @remarks
* Reference:
* https://fxhash-documentation.super.site/480dd683bdb447ec8a20eeacbe320188
*/
export interface FxProjectSDK {
/**
* A random 64 characters hexadecimal string. This particular variable will be
* hardcoded with a static hash when someone mints a token from your GT
*/
hash: string,
/**
* trigger for capture module
*/
preview: () => void,
/**
* is TRUE when capture module is running the project
*/
isPreview: boolean,
/**
* sets your projects features
*/
features: (features: any) => void,
/**
* get all features
*/
getFeatures: () => any
}
10 changes: 2 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,10 @@ import {
warpPoints,
} from "@thi.ng/geom";
import { draw } from "@thi.ng/hiccup-canvas";
import type { FxProjectSDK, State } from "./api";
import "@fxhash/project-sdk";
import type { State } from "./api";
import { resolveState } from "./state";

// these declarations ensure TypeScript is aware of these
// externally defined vars/functions
declare global {
interface Window {
$fx: FxProjectSDK
}
}
// flag to guard code blocks which are only wanted during development
// any `if (DEBUG) { ... }` code blocks will be removed in production builds
const DEBUG = process.env.NODE_ENV !== "production";
Expand Down