|
| 1 | +/* |
| 2 | +* Copyright (c) 2025-2026 Moddable Tech, Inc. |
| 3 | +* |
| 4 | +* This file is part of the Moddable SDK Tools. |
| 5 | +* |
| 6 | +* The Moddable SDK Tools is free software: you can redistribute it and/or modify |
| 7 | +* it under the terms of the GNU General Public License as published by |
| 8 | +* the Free Software Foundation, either version 3 of the License, or |
| 9 | +* (at your option) any later version. |
| 10 | +* |
| 11 | +* The Moddable SDK Tools is distributed in the hope that it will be useful, |
| 12 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | +* GNU General Public License for more details. |
| 15 | +* |
| 16 | +* You should have received a copy of the GNU General Public License |
| 17 | +* along with the Moddable SDK Tools. If not, see <http://www.gnu.org/licenses/>. |
| 18 | +* |
| 19 | +*/ |
| 20 | + |
| 21 | +/// <reference path="../commodetto/Poco.d.ts" /> |
| 22 | + |
| 23 | + |
| 24 | +declare module "commodetto/Poco" { |
| 25 | + import Bitmap from "commodetto/Bitmap"; |
| 26 | + |
| 27 | + interface FontConstructor { |
| 28 | + new(family: string, size: number): Font; |
| 29 | + } |
| 30 | + |
| 31 | + interface PocoPrototype { |
| 32 | + Font: FontConstructor; |
| 33 | + unobstructed: { |
| 34 | + readonly x: number; |
| 35 | + readonly y: number; |
| 36 | + readonly width: number; |
| 37 | + readonly height: number |
| 38 | + }; |
| 39 | + drawLine(x0: number, y0: number, x1: number, y1: number, color: number, width: number): void; |
| 40 | + drawRoundRect(x0: number, y0: number, x1: number, y1: number, color: number, radius: number, corners: number): void; |
| 41 | + frameRoundRect(x0: number, y0: number, x1: number, y1: number, color: number, radius: number): void; |
| 42 | + drawCircle(color: number, x: number, y: number, r: number, from: number, to: number): void; |
| 43 | + drawDCI(dci: PebbleDrawCommandImage | PebbleDrawCommandSequence, x: number, y: number): void; |
| 44 | + } |
| 45 | + |
| 46 | + class PebbleBitmap extends Bitmap { |
| 47 | + constructor(id: number | string); |
| 48 | + } |
| 49 | + |
| 50 | + class PebbleDrawCommandList { |
| 51 | + scale(x: number, y: number): this; |
| 52 | + scale(scale: number): this; |
| 53 | + rotate(angle: number, cx: number, cy: number): this; |
| 54 | + } |
| 55 | + |
| 56 | + class PebbleDrawCommandImage extends PebbleDrawCommandList { |
| 57 | + constructor(id: number | string); |
| 58 | + readonly width: number; |
| 59 | + readonly height: number; |
| 60 | + clone(): PebbleDrawCommandImage; |
| 61 | + } |
| 62 | + |
| 63 | + class PebbleDrawCommandSequence { |
| 64 | + constructor(id: number | string); |
| 65 | + readonly width: number; |
| 66 | + readonly height: number; |
| 67 | + readonly duration: number; |
| 68 | + readonly frameDuration: number; |
| 69 | + time: number; |
| 70 | + clone(): PebbleDrawCommandSequence; |
| 71 | + } |
| 72 | + |
| 73 | + interface PocoConstructor { |
| 74 | + PebbleBitmap: typeof PebbleBitmap; |
| 75 | + PebbleDrawCommandImage: typeof PebbleDrawCommandImage; |
| 76 | + PebbleDrawCommandSequence: typeof PebbleDrawCommandSequence; |
| 77 | + PebbleDrawCommandList: typeof PebbleDrawCommandList; |
| 78 | + } |
| 79 | +} |
0 commit comments