Skip to content

Commit 0fd6549

Browse files
quotes
1 parent 0dabc70 commit 0fd6549

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

examples/restaurant/src/foodOrderViewSchema.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@ export type Order = {
33
items: (OrderItem | UnknownText)[];
44
};
55

6-
export type OrderItem = Pizza | Beer | Salad | NamedPizza;
6+
export type OrderItem = Pizza | Beer | Salad;
77

88
// Use this type for order items that match nothing else
99
export interface UnknownText {
10-
itemType: 'unknown',
10+
itemType: "unknown",
1111
text: string; // The text that wasn't understood
1212
}
1313

14-
1514
export type Pizza = {
16-
itemType: 'pizza';
15+
itemType: "pizza";
1716
// default: large
18-
size?: 'small' | 'medium' | 'large' | 'extra large';
17+
size?: "small" | "medium" | "large" | "extra large";
1918
// toppings requested (examples: pepperoni, arugula)
2019
addedToppings?: string[];
2120
// toppings requested to be removed (examples: fresh garlic, anchovies)
@@ -26,23 +25,20 @@ export type Pizza = {
2625
name?: "Hawaiian" | "Yeti" | "Pig In a Forest" | "Cherry Bomb";
2726
};
2827

29-
export interface NamedPizza extends Pizza {
30-
}
31-
3228
export type Beer = {
33-
itemType: 'beer';
29+
itemType: "beer";
3430
// examples: Mack and Jacks, Sierra Nevada Pale Ale, Miller Lite
3531
kind: string;
3632
// default: 1
3733
quantity?: number;
3834
};
3935

40-
export const saladSize = ['half', 'whole'];
36+
export const saladSize = ["half", "whole"];
4137

42-
export const saladStyle = ['Garden', 'Greek'];
38+
export const saladStyle = ["Garden", "Greek"];
4339

4440
export type Salad = {
45-
itemType: 'salad';
41+
itemType: "salad";
4642
// default: half
4743
portion?: string;
4844
// default: Garden

0 commit comments

Comments
 (0)