-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 generic interface ShapeObject over type and options
ShapeObject interface from kittik-shape-basic is generic over type of the shape and options it can accept now
- Loading branch information
Showing
18 changed files
with
97 additions
and
67 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { ShapeOptions } from './ShapeOptions'; | ||
|
||
export interface ShapeObject { | ||
type: string | ||
options?: Partial<ShapeOptions> | ||
export interface ShapeObject<T, O extends ShapeOptions> { | ||
type: T | ||
options: O | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import { CodeOptions } from './CodeOptions'; | ||
import { ShapeObject } from 'kittik-shape-basic'; | ||
|
||
export interface CodeObject extends ShapeObject { | ||
options?: Partial<CodeOptions> | ||
} | ||
export type CodeObject = ShapeObject<'Code', CodeOptions>; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import { FigTextOptions } from './FigTextOptions'; | ||
import { ShapeObject } from 'kittik-shape-basic'; | ||
|
||
export interface FigTextObject extends ShapeObject { | ||
options?: Partial<FigTextOptions> | ||
} | ||
export type FigTextObject = ShapeObject<'FigText', FigTextOptions>; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import { ImageOptions } from './ImageOptions'; | ||
import { ShapeObject } from 'kittik-shape-basic'; | ||
|
||
export interface ImageObject extends ShapeObject { | ||
options?: Partial<ImageOptions> | ||
} | ||
export type ImageObject = ShapeObject<'Image', ImageOptions>; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import { RectangleOptions } from './RectangleOptions'; | ||
import { ShapeObject } from 'kittik-shape-basic'; | ||
|
||
export interface RectangleObject extends ShapeObject { | ||
options?: Partial<RectangleOptions> | ||
} | ||
export type RectangleObject = ShapeObject<'Rectangle', RectangleOptions>; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import { ShapeObject } from 'kittik-shape-basic'; | ||
import { TextOptions } from './TextOptions'; | ||
|
||
export interface TextObject extends ShapeObject { | ||
options?: Partial<TextOptions> | ||
} | ||
export type TextObject = ShapeObject<'Text', TextOptions>; |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { ShapeObject } from 'kittik-shape-basic'; | ||
import { ShapeObject, ShapeOptions } from 'kittik-shape-basic'; | ||
|
||
export interface ShapeDeclaration extends ShapeObject { | ||
export interface ShapeDeclaration<T, O extends ShapeOptions> extends ShapeObject<T, O> { | ||
name: string | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import { AnimationDeclaration } from '../animation/AnimationDeclaration'; | ||
import { OrderDeclaration } from './OrderDeclaration'; | ||
import { ShapeDeclaration } from '../shape/ShapeDeclaration'; | ||
import { ShapeOptions } from 'kittik-shape-basic'; | ||
import { ShapeType } from '../shape/Shapes'; | ||
|
||
export interface SlideDeclaration { | ||
name: string | ||
shapes: ShapeDeclaration[] | ||
shapes: Array<ShapeDeclaration<ShapeType, ShapeOptions>> | ||
animations?: AnimationDeclaration[] | ||
order: OrderDeclaration[] | ||
} |