Skip to content

Instantly share code, notes, and snippets.

@Narazaka
Created July 9, 2016 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Narazaka/036b30ea9e1bbe2cc86ed81c61e0bca0 to your computer and use it in GitHub Desktop.
Save Narazaka/036b30ea9e1bbe2cc86ed81c61e0bca0 to your computer and use it in GitHub Desktop.
Ukagaka Shell API v2?
export class Directory {
}
export class Descript {
}
export class ShellData {
static async buildFromDirectory(directory: Directory): Promise<ShellData>;
constructor(surfaceResources, surfaceDefinitions);
unload(): void;
descript: Descript;
}
export class BalloonData {
static async buildFromDirectory(directory: Directory): Promise<BalloonData>;
constructor(surfaceResources, surfaceDefinitions);
unload(): void;
descript: Descript;
}
export interface Attachable {
attachTo(element: Element): void;
detachFrom(element: Element): void;
element: Element;
}
export class NamedManager implements Attachable {
constructor(element?: Element);
destructor(): void;
materialize(shellData: ShellData, balloonData: BalloonData): Named;
vanish(id: number): void;
named(id: number): Named;
}
export class Named implements Attachable {
constructor(id: number, shellData: ShellData, balloonData: BalloonData, element?: Element);
id: number;
vanish(): void;
changeShell(shellData: ShellData): void;
changeBalloon(balloonData: BalloonData): void;
scope(id?: number): Scope;
openInputBox(id: string, placeHolder?: string): InputBox;
closeInputBox(id: string): void;
openCommunicateBox(id: string, placeHolder?: string): CommunicateBox;
closeCommunicateBox(id: string): void;
openTeachBox(id: string, placeHolder?: string): TeachBox;
closeTeachBox(id: string): void;
openContextMenu(source: ContextMenuSource): ContextMenu;
closeContextMenu(): void;
moveAwayScopes(ids: number[]); // \4
stickScopes(ids: number[]); // \5
}
export class InputBoxBase implements Attachable {
id: number;
placeHolder: string;
close(): void;
}
export class InputBox extends InputBoxBase {
}
export class CommunicateBox extends InputBoxBase {
}
export class TeachBox extends InputBoxBase {
}
export class ContextMenu implements Attachable {
}
export class ContextMenuSource {
}
export class Position {
parent: Position;
display_id: number;
x: number;
y: number;
xOrigin: XOrigin;
yOrigin: YOrigin;
xFixed: boolean;
yFixed: boolean;
set(x: number, y: number): void; // absolute
move(x: number, y: number): void; // relative
}
export enum XOrigin {
Right = 1,
Left,
}
export enum YOrigin {
Bottom = 1,
Top,
}
export class Size {
width: number;
height: number;
}
export class Scope implements Attachable, TreatsSakuraScriptCommand {
id: number;
position: Position;
shell: ScopeShell;
balloon: ScopeBalloon;
scriptBreak(): void; // yenE
talk(): void;
}
export class ScopeShell implements Attachable {
constructor(shellData: ShellData, element?: Element);
destructor(): void;
position: Position;
surface(id?: number): ShellSurface;
bind(id: number): void;
bindByName(category: string, parts: string): void;
unbind(id: number): void;
unbindByName(category: string, parts: string): void;
isBound(id: number): boolean;
isBoundByName(category: string, parts: string): boolean;
bindGroups: BindGroup[];
showRegion(): void;
hideRegion(): void;
regionVisible: boolean;
}
export class BindGroup {
id: number;
category: string;
parts: string;
thumbnail: string;
}
export class ScopeBalloon implements Attachable {
constructor(balloonData: BalloonData, element?: Element);
destructor(): void;
position: Position;
surface(id?: number): BalloonSurface;
}
export class ShellSurface implements Attachable {
size: Size;
async playAnimation(id: number): Promise;
stopAnimation(id: number): void;
}
export class BalloonSurface implements Attachable, TreatsSakuraScriptCommand {
size: Size;
side(side: BalloonSide): void;
}
export enum BalloonSide {
Left = 1,
Right,
}
export interface TreatsSakuraScriptCommand {
anchorBegin(id: string, ...args: string[]): void
anchorEnd(): void;
choice(text: string, id: string, ...args: string[]): void;
choiceBegin(id: string, ...args: string[]): void;
choiceEnd(): void;
talk(test: string): void;
timeCritical(state?: boolean): boolean;
synchronized(scopes?: number[]): number[];
marker(): void;
clear(): void;
br(ratio: number): void;
showWait(): void;
font(name: string, ...values: string[]): void;
location(x: string, y ?: string): void;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment