-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
158 additions
and
7 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
11 changes: 11 additions & 0 deletions
11
src/app/Controllers/MessageSegments/mseg-file.component.ts
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Component, input } from "@angular/core"; | ||
import { MessageSegmentFile } from "../../Models/Messages/MessageSegments"; | ||
|
||
@Component({ | ||
selector: 'app-mseg-text', | ||
templateUrl: '../../Views/MessageSegments/mseg-file.html', | ||
// styleUrls: ['../../Styles/MessageSegments/message-segment-text.scss'] | ||
}) | ||
export class MessageSegmentFileComponent { | ||
context = input.required<MessageSegmentFile>(); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Component, input } from "@angular/core"; | ||
import { MessageSegmentImage } from "../../Models/Messages/MessageSegments"; | ||
|
||
@Component({ | ||
selector: 'app-mseg-img', | ||
templateUrl: '../../Views/MessageSegments/mseg-img.html', | ||
// styleUrls: ['../../Styles/MessageSegments/message-segment-text.scss'] | ||
}) | ||
export class MessageSegmentImgComponent { | ||
context = input.required<MessageSegmentImage>(); | ||
} |
11 changes: 11 additions & 0 deletions
11
src/app/Controllers/MessageSegments/mseg-text.component.ts
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Component, input } from "@angular/core"; | ||
import { MessageSegmentText } from "../../Models/Messages/MessageSegments"; | ||
|
||
@Component({ | ||
selector: 'app-mseg-text', | ||
templateUrl: '../../Views/MessageSegments/mseg-text.html', | ||
// styleUrls: ['../../Styles/MessageSegments/message-segment-text.scss'] | ||
}) | ||
export class MessageSegmentTextComponent { | ||
context = input.required<MessageSegmentText>(); | ||
} |
11 changes: 11 additions & 0 deletions
11
src/app/Controllers/MessageSegments/mseg-video.component.ts
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Component, input } from "@angular/core"; | ||
import { MessageSegmentVideo } from "../../Models/Messages/MessageSegments"; | ||
|
||
@Component({ | ||
selector: 'app-mseg-video', | ||
templateUrl: '../../Views/MessageSegments/mseg-video.html', | ||
// styleUrls: ['../../Styles/MessageSegments/message-segment-text.scss'] | ||
}) | ||
export class MessageSegmentVideoComponent { | ||
context = input.required<MessageSegmentVideo>(); | ||
} |
11 changes: 11 additions & 0 deletions
11
src/app/Controllers/MessageSegments/mseg-voice.component.ts
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Component, input } from "@angular/core"; | ||
import { MessageSegmentVoice } from "../../Models/Messages/MessageSegments"; | ||
|
||
@Component({ | ||
selector: 'app-mseg-voice', | ||
templateUrl: '../../Views/MessageSegments/mseg-voice.html', | ||
// styleUrls: ['../../Styles/MessageSegments/message-segment-text.scss'] | ||
}) | ||
export class MessageSegmentVoiceComponent { | ||
context = input.required<MessageSegmentVoice>(); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Component, input } from '@angular/core'; | ||
import { Message } from '../Models/Message'; | ||
|
||
@Component({ | ||
selector: 'app-message', | ||
templateUrl: '../Views/message.html', | ||
}) | ||
export class MessageComponent { | ||
message = input.required<Message>(); | ||
isByMe = input<boolean>(false); | ||
groupWithPrevious = input<boolean>(false); | ||
isSending = input<boolean>(false); | ||
isFailed = input<boolean>(false); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { MessageSegmentBase } from "./MessageSegments"; | ||
|
||
export interface MessageContent { | ||
preview?: string; | ||
segments: MessageSegmentBase[]; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
export type MessageSegmentTypes = ( | ||
| MessageSegmentText | ||
| MessageSegmentImage | ||
| MessageSegmentVideo | ||
| MessageSegmentVoice | ||
| MessageSegmentFile | ||
| MessageSegmentContact | ||
| MessageSegmentThreadInvitation | ||
| MessageSegmentThreadJoinRequest | ||
)['type']; | ||
|
||
export interface MessageSegmentBase { | ||
type: MessageSegmentTypes; | ||
} | ||
|
||
export interface MessageSegmentText extends MessageSegmentBase { | ||
type: 'text'; | ||
content: string; | ||
} | ||
|
||
interface MessageSegmentFileLike<TName extends MessageSegmentTypes> extends MessageSegmentBase { | ||
type: TName; | ||
url: string; | ||
} | ||
|
||
export interface MessageSegmentImage extends MessageSegmentFileLike<'image'> { | ||
width: number; | ||
height: number; | ||
alt?: string; | ||
} | ||
|
||
export type MessageSegmentVideo = MessageSegmentFileLike<'video'>; | ||
|
||
export interface MessageSegmentVoice extends MessageSegmentFileLike<'voice'> { | ||
duration: number; | ||
} | ||
|
||
export interface MessageSegmentFile extends MessageSegmentFileLike<'file'> { | ||
fileName: string; | ||
size: number; | ||
} | ||
|
||
export interface MessageSegmentContact extends MessageSegmentBase { | ||
type: 'contact'; | ||
id: string; | ||
nickname: string; | ||
avatarUrl: string; | ||
bio: string; | ||
} | ||
|
||
export interface MessageSegmentThreadInvitation extends MessageSegmentBase { | ||
type: 'thread-invitation'; | ||
id: string; | ||
token: string; | ||
validTo: Date; | ||
} | ||
|
||
export interface MessageSegmentThreadJoinRequest extends MessageSegmentBase { | ||
type: 'thread-join-request'; | ||
id: string; | ||
token: string; | ||
validTo: Date; | ||
} |
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,13 +1,13 @@ | ||
/** | ||
* Example input: <{a: string, b: boolean, c: number, d: boolean}, boolean> | ||
* Example output: {b: boolean, d: boolean} | ||
* Example input: `<{a: string, b: boolean, c: number, d: boolean}, boolean>` | ||
* Example output: `{b: boolean, d: boolean}` | ||
*/ | ||
export type PropertiesWithType<T, P> = { | ||
[K in keyof T as T[K] extends P ? K : never]: T[K]; | ||
}; | ||
|
||
/** | ||
* Example input: <{a: string, b: boolean, c: number, d: boolean}, boolean> | ||
* Example output: 'b' | 'd' | ||
* Example input: `<{a: string, b: boolean, c: number, d: boolean}, boolean>` | ||
* Example output: `'b' | 'd'` | ||
*/ | ||
export type PropertryNamesWithType<T, P> = keyof PropertiesWithType<T, P>; |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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