type SessionAttributes = { email: string; isAdmin: boolean; provider: string; termsOfServiceSigned: boolean; unsignedClientContracts: string[]; unsignedOwnerContracts: string[]; wishlistToken: null | string; incompleteSignup: boolean; }; type SessionOptions = { serialized?: boolean; fields?: 'attributes' | 'id' | 'type'; optionalAttributes?: boolean; }; type SessionFieldsCondition = Options['fields'] extends keyof SessionFields ? Options['fields'] : keyof SessionFields; type SessionAttributesCondition = AttributeOptions extends true ? Partial : SessionAttributes; type SessionFields = { attributes: SessionAttributesCondition; id: string; type: string; }; type SessionCondition = Options['serialized'] extends true ? 'id' : keyof SessionFields; type SessionFieldsPick = Pick, SessionFieldsCondition>; type SessionSerialize = Pick, SessionCondition> & SessionAttributesCondition; export type Session = Options['serialized'] extends true ? SessionSerialize : SessionFieldsPick; export {};