added agendas
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"name": "@prometeu/sdk",
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
"types": "types/index.d.ts"
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
export function createPrometeuEslintConfig({ tsParser, tseslint }) {
|
||||
if (!tsParser || !tseslint) {
|
||||
throw new Error(
|
||||
"createPrometeuEslintConfig requires { tsParser, tseslint } provided by the project (root node_modules).",
|
||||
);
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
files: ["**/*.ts", "**/*.tsx"],
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
parserOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
"@typescript-eslint": tseslint,
|
||||
},
|
||||
rules: {
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"warn",
|
||||
{
|
||||
varsIgnorePattern: "^(frame)$",
|
||||
},
|
||||
],
|
||||
"@typescript-eslint/typedef": [
|
||||
"error",
|
||||
{
|
||||
variableDeclaration: false,
|
||||
variableDeclarationIgnoreFunction: false,
|
||||
|
||||
parameter: true,
|
||||
propertyDeclaration: true,
|
||||
memberVariableDeclaration: true,
|
||||
arrowParameter: true,
|
||||
},
|
||||
],
|
||||
|
||||
"no-restricted-syntax": [
|
||||
"error",
|
||||
{
|
||||
selector: "TSUnionType:not(:has(TSNullKeyword))",
|
||||
message:
|
||||
"Union types are not allowed in Prometeu code style (exception: T | null).",
|
||||
},
|
||||
{
|
||||
selector: "TSUnionType:has(TSUndefinedKeyword)",
|
||||
message:
|
||||
"Use null (T | null) instead of undefined (T | undefined) in Prometeu code style.",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"noImplicitThis": true,
|
||||
"alwaysStrict": true,
|
||||
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
|
||||
"exactOptionalPropertyTypes": true,
|
||||
"useUnknownInCatchVariables": true,
|
||||
|
||||
"noUncheckedIndexedAccess": true,
|
||||
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
-99
@@ -1,99 +0,0 @@
|
||||
export {}; // that is a module, should not include any other scope here
|
||||
|
||||
declare global {
|
||||
namespace Prometeu {
|
||||
type Color565 = number & { readonly __brand: "Color565" };
|
||||
|
||||
interface Button {
|
||||
readonly down: boolean;
|
||||
readonly pressed: boolean;
|
||||
readonly released: boolean;
|
||||
readonly holdFrames: number;
|
||||
}
|
||||
|
||||
interface Pad {
|
||||
readonly up: Button;
|
||||
readonly down: Button;
|
||||
readonly left: Button;
|
||||
readonly right: Button;
|
||||
readonly a: Button;
|
||||
readonly b: Button;
|
||||
readonly x: Button;
|
||||
readonly y: Button;
|
||||
readonly l: Button;
|
||||
readonly r: Button;
|
||||
readonly start: Button;
|
||||
readonly select: Button;
|
||||
}
|
||||
|
||||
interface Touch {
|
||||
readonly x: number;
|
||||
readonly y: number;
|
||||
readonly button: Button;
|
||||
}
|
||||
|
||||
interface Gfx {
|
||||
clear(color: Color565): void;
|
||||
|
||||
fillRect(x: number, y: number, w: number, h: number, color: Color565): void;
|
||||
drawLine(x1: number, y1: number, x2: number, y2: number, color: Color565): void;
|
||||
drawCircle(x: number, y: number, r: number, color: Color565): void;
|
||||
drawDisc(x: number, y: number, r: number, borderColor: Color565, fillColor: Color565): void;
|
||||
drawSquare(x: number, y: number, w: number, h: number, borderColor: Color565, fillColor: Color565): void;
|
||||
drawText(x: number, y: number, s: string, color: Color565): void;
|
||||
|
||||
setSprite(assetName: string, id: number, x: number, y: number, tileId: number, paletteId: number, active: boolean, flipX: boolean, flipY: boolean, priority: number): void;
|
||||
}
|
||||
|
||||
interface Color {
|
||||
readonly black: Color565;
|
||||
readonly white: Color565;
|
||||
readonly red: Color565;
|
||||
readonly green: Color565;
|
||||
readonly blue: Color565;
|
||||
readonly yellow: Color565;
|
||||
readonly cyan: Color565;
|
||||
readonly magenta: Color565;
|
||||
readonly indigo: Color565;
|
||||
readonly color_key: Color565;
|
||||
readonly orange: Color565;
|
||||
readonly gray: Color565;
|
||||
readonly grey: Color565;
|
||||
rgb(r: number, g: number, b: number): Color565;
|
||||
}
|
||||
|
||||
interface System {
|
||||
hasCart(): boolean;
|
||||
}
|
||||
|
||||
interface Audio {
|
||||
playSample(sampleId: number, voiceId: number, volume: number, pan: number, pitch: number): void;
|
||||
play(assetName: string, sampleId: number, voiceId: number, volume: number, pan: number, pitch: number, loopMode: number): void;
|
||||
}
|
||||
|
||||
interface Fs {
|
||||
open(path: string): number;
|
||||
read(handle: number): string | null;
|
||||
write(handle: number, content: string): boolean;
|
||||
close(handle: number): void;
|
||||
listDir(path: string): string | null;
|
||||
exists(path: string): boolean;
|
||||
delete(path: string): boolean;
|
||||
}
|
||||
|
||||
interface Log {
|
||||
write(level: number, msg: string): void;
|
||||
writeTag(level: number, tag: number, msg: string): void;
|
||||
}
|
||||
}
|
||||
|
||||
export const color: Prometeu.Color;
|
||||
export const pad: Prometeu.Pad;
|
||||
export const touch: Prometeu.Touch;
|
||||
export const gfx: Prometeu.Gfx;
|
||||
export const audio: Prometeu.Audio;
|
||||
export const fs: Prometeu.Fs;
|
||||
export const log: Prometeu.Log;
|
||||
export const system: Prometeu.System;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user