Created
September 7, 2021 00:11
-
-
Save metehus/219ae1c4efcdbb5358ff3ec056f688ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import { Plugin, PrestionProject, Slide } from "."; | |
class PrestionProject { | |
public config: PrestionProjectConfig | |
public slides: Slide<this>[] | |
constructor(config: PrestionProjectConfigOptionals = {}) { | |
this.config = config as PrestionProjectConfig | |
this.slides = this.config.slides.map(Slide => new Slide(this)) | |
} | |
} | |
class Slide<P extends PrestionProject> { | |
public engine: P | |
constructor(engine: P) { | |
this.engine = engine | |
} | |
} | |
export interface SlideConstructor { | |
new (engine: PrestionProject): Slide<PrestionProject>; | |
} | |
export interface PrestionProjectConfig { | |
name: string, | |
slides: SlideConstructor[], | |
// plugins: Plugin<PrestionProject>[], | |
element: string | HTMLElement, | |
} | |
export interface PrestionProjectConfigOptionals { | |
name?: string, | |
slides?: SlideConstructor[], | |
// plugins?: Plugin<PrestionProject>[], | |
element?: string | HTMLElement, | |
} | |
class CustomPrestionProject extends PrestionProject { | |
public teste(a: string) { | |
} | |
} | |
class BomDia extends Slide<CustomPrestionProject> { | |
start () { | |
this.engine.teste("a") | |
} | |
} | |
const prestion = new CustomPrestionProject({ | |
slides: [ | |
BomDia | |
] | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment