SchemaTypeの型計算量を削減 (#8332)
* schema typeの型計算量を削減 * reduce some type error * wip * fix * clean up * more shrink
This commit is contained in:
parent
b6db709e02
commit
fd8f8162e1
9 changed files with 57 additions and 105 deletions
|
@ -14,12 +14,12 @@ export const meta = {
|
|||
properties: {
|
||||
state: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
optional: true, nullable: false,
|
||||
enum: ['already-subscribed', 'subscribed'],
|
||||
},
|
||||
key: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -49,7 +49,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||
|
||||
if (exist != null) {
|
||||
return {
|
||||
state: 'already-subscribed',
|
||||
state: 'already-subscribed' as const,
|
||||
key: instance.swPublicKey,
|
||||
};
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||
});
|
||||
|
||||
return {
|
||||
state: 'subscribed',
|
||||
state: 'subscribed' as const,
|
||||
key: instance.swPublicKey,
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue