Created
March 31, 2025 09:51
-
-
Save paradite/ae2e33a711195853db33923762176089 to your computer and use it in GitHub Desktop.
doesn't work bro
This file contains hidden or 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
type State = 'initialized' | 'processing' | 'completed' | 'failed'; | |
interface Pipeline<T extends State> { | |
state: T; | |
start(this: Pipeline<'initialized'>): Pipeline<'processing'>; | |
finish(this: Pipeline<'processing'>): Pipeline<'completed'>; | |
retry(this: Pipeline<'failed'>): Pipeline<'processing'>; | |
} | |
declare const p: Pipeline<'initialized'>; | |
p.start(); | |
p.finish(); | |
// p.retry(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment