forked from kubernetes/test-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework spyglass lenses to be isolated properly.
- Loading branch information
Showing
45 changed files
with
1,502 additions
and
1,110 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
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
export interface BaseMessage { | ||
type: string; | ||
} | ||
|
||
function isBaseMessage(data: any): data is BaseMessage { | ||
return typeof data.type === 'string'; | ||
} | ||
|
||
export interface ContentUpdatedMessage extends BaseMessage{ | ||
type: 'contentUpdated'; | ||
height: number; | ||
} | ||
|
||
export interface RequestMessage extends BaseMessage { | ||
type: 'request'; | ||
data: string; | ||
} | ||
|
||
export interface RequestPageMessage extends BaseMessage { | ||
type: 'requestPage'; | ||
data: string; | ||
} | ||
|
||
export interface UpdatePageMessage extends BaseMessage { | ||
type: 'updatePage'; | ||
data: string; | ||
} | ||
|
||
export interface Response extends BaseMessage { | ||
type: 'response'; | ||
data: string; | ||
} | ||
|
||
export function isResponse(data: any): data is Response { | ||
return isBaseMessage(data) && data.type === 'response'; | ||
} | ||
|
||
export type Message = ContentUpdatedMessage | RequestMessage | RequestPageMessage | UpdatePageMessage | Response; | ||
|
||
export interface TransitMessage { | ||
id: number; | ||
message: Message; | ||
} | ||
|
||
export function isTransitMessage(data: any): data is TransitMessage { | ||
return typeof data.id === 'number' && data.message && typeof data.message.type === 'string'; | ||
} |
Oops, something went wrong.