https://github.com/darcdev/flickr-entities-typescript
Define entities in typescript 🔘☄
https://github.com/darcdev/flickr-entities-typescript
Last synced: 11 months ago
JSON representation
Define entities in typescript 🔘☄
- Host: GitHub
- URL: https://github.com/darcdev/flickr-entities-typescript
- Owner: darcdev
- Created: 2021-01-01T21:41:47.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-04T20:20:04.000Z (about 5 years ago)
- Last Synced: 2025-02-06T14:22:41.442Z (about 1 year ago)
- Language: TypeScript
- Size: 12.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flickr Entities

#### Define Flickr entities using Typescript Language
## Enum
### PhotoOrientation
```ts
enum PhotoOrientation {
Landscape,
Portrait,
Square,
Panorama,
}
```
## Entities
### Item
```ts
class Item {
constructor(public readonly id: number, protected title: string) {}
}
```
### Picture
```ts
class Picture extends Item {
public constructor(
id: number,
title: string,
private _date: string,
private _orientation: PhotoOrientation
) {
super(id, title);
}
public toString() {}
}
```
### Album
```ts
class Album extends Item {
private pictures: Picture[];
public constructor(id: number, title: string) {
super(id, title);
this.pictures = [];
}
public addPicture(picture: Picture) {}
}
```
### User
```ts
class User {
private album: Album[];
constructor(
private id: number,
private username: string,
private firstName: string,
private isPro: boolean
) {
this.album = [];
}
addAlbum(album: Album) {}
removeAlbum(album: Album): Album | undefined {}
}
```