diff --git a/src/index.ts b/src/index.ts index b6a4dbb..868a7b5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,38 @@ import { Event, IEvent } from "oni-types" export type DisposeFunction = () => void +/** + * API surface area for our Achievements integration + */ +export namespace Achievements { + + /** + * Definition of an achievement + * + * An achievement consists of a name, title, along with one or more sub goals + */ + export interface Definition { + uniqueId: string + name: string + description: string + + goals: Goal[] + } + + export interface Goal { + name: string + goalId: string + count: number + } + + export interface Api { + notifyGoal(goalId: string): void + registerAchievement(definition: Definition): void + + onAchievementAccomplished: IEvent + } +} + /** * API surface area for registering and executing commands */ @@ -574,6 +606,7 @@ export namespace Plugin { } export interface Api extends EventEmitter { + achievements: Achievements.Api automation: Automation.Api colors: IColors commands: Commands.Api