make all specs nilable

This commit is contained in:
Andrey Shovkoplyas 2017-07-11 14:54:01 +03:00 committed by Roman Volosovskyi
parent 6e5e6200ab
commit 1485e07259
10 changed files with 82 additions and 82 deletions

View File

@ -1,9 +1,9 @@
(ns status-im.accounts.specs (ns status-im.accounts.specs
(:require [cljs.spec.alpha :as s])) (:require [cljs.spec.alpha :as s]))
(s/def :accounts/accounts map?) ;;{id (string) account (map)} all created accounts (s/def :accounts/accounts (s/nilable map?)) ;;{id (string) account (map)} all created accounts
(s/def :accounts/account-creation? (s/nilable boolean?)) ;;true during creating new account (s/def :accounts/account-creation? (s/nilable boolean?)) ;;true during creating new account
(s/def :accounts/creating-account? boolean?) ;;what is the difference ? ^ (s/def :accounts/creating-account? (s/nilable boolean?)) ;;what is the difference ? ^
(s/def :accounts/current-account-id (s/nilable string?)) ;;id of logged in account (s/def :accounts/current-account-id (s/nilable string?)) ;;id of logged in account
(s/def :accounts/recover (s/nilable map?)) ;;used during recovering account (s/def :accounts/recover (s/nilable map?)) ;;used during recovering account
(s/def :accounts/login map?) ;;used during logging (s/def :accounts/login (s/nilable map?)) ;;used during logging

View File

@ -1,32 +1,32 @@
(ns status-im.chat.specs (ns status-im.chat.specs
(:require [cljs.spec.alpha :as s])) (:require [cljs.spec.alpha :as s]))
(s/def :chat/chats map?) ;; {id (string) chat (map)} active chats on chat's tab (s/def :chat/chats (s/nilable map?)) ;; {id (string) chat (map)} active chats on chat's tab
(s/def :chat/current-chat-id string?) ;;current or last opened chat-id (s/def :chat/current-chat-id (s/nilable string?)) ;;current or last opened chat-id
(s/def :chat/chat-id string?) ;;what is the difference ? ^ (s/def :chat/chat-id (s/nilable string?)) ;;what is the difference ? ^
(s/def :chat/new-chat map?) ;;used during adding new chat (s/def :chat/new-chat (s/nilable map?)) ;;used during adding new chat
(s/def :chat/new-chat-name string?) ;;we have name in the new-chat why do we need this field (s/def :chat/new-chat-name (s/nilable string?)) ;;we have name in the new-chat why do we need this field
(s/def :chat/chat-animations map?) ;;{id (string) props (map)} (s/def :chat/chat-animations (s/nilable map?)) ;;{id (string) props (map)}
(s/def :chat/chat-ui-props map?) ;;{id (string) props (map)} (s/def :chat/chat-ui-props (s/nilable map?)) ;;{id (string) props (map)}
(s/def :chat/chat-list-ui-props map?) (s/def :chat/chat-list-ui-props (s/nilable map?))
(s/def :chat/layout-height number?) ;;height of chat's view layout (s/def :chat/layout-height (s/nilable number?)) ;;height of chat's view layout
(s/def :chat/expandable-view-height-to-value number?) (s/def :chat/expandable-view-height-to-value (s/nilable number?))
(s/def :chat/global-commands map?) ; {key (keyword) command (map)} atm used for browse command (s/def :chat/global-commands (s/nilable map?)) ; {key (keyword) command (map)} atm used for browse command
(s/def :chat/loading-allowed boolean?) ;;allow to load more messages (s/def :chat/loading-allowed (s/nilable boolean?)) ;;allow to load more messages
(s/def :chat/message-data map?) (s/def :chat/message-data (s/nilable map?))
(s/def :chat/message-id->transaction-id map?) (s/def :chat/message-id->transaction-id (s/nilable map?))
(s/def :chat/message-status map?) (s/def :chat/message-status (s/nilable map?))
(s/def :chat/unviewed-messages (s/nilable map?)) (s/def :chat/unviewed-messages (s/nilable map?))
(s/def :chat/selected-participants set?) (s/def :chat/selected-participants (s/nilable set?))
(s/def :chat/chat-loaded-callbacks map?) (s/def :chat/chat-loaded-callbacks (s/nilable map?))
(s/def :chat/commands-callbacks map?) (s/def :chat/commands-callbacks (s/nilable map?))
(s/def :chat/command-hash-valid? boolean?) (s/def :chat/command-hash-valid? (s/nilable boolean?))
(s/def :chat/public-group-topic string?) (s/def :chat/public-group-topic (s/nilable string?))
(s/def :chat/confirmation-code-sms-listener any?) ; .addListener result object (s/def :chat/confirmation-code-sms-listener (s/nilable any?)) ; .addListener result object
(s/def :chat/messages seq?) (s/def :chat/messages (s/nilable seq?))
(s/def :chat/loaded-chats seq?) (s/def :chat/loaded-chats (s/nilable seq?))
(s/def :chat/bot-subscriptions map?) (s/def :chat/bot-subscriptions (s/nilable map?))
(s/def :chat/new-request map?) (s/def :chat/new-request (s/nilable map?))
(s/def :chat/raw-unviewed-messages vector?) (s/def :chat/raw-unviewed-messages (s/nilable vector?))
(s/def :chat/bot-db map?) (s/def :chat/bot-db (s/nilable map?))
(s/def :chat/geolocation map?) (s/def :chat/geolocation (s/nilable map?))

View File

@ -1,15 +1,15 @@
(ns status-im.contacts.specs (ns status-im.contacts.specs
(:require [cljs.spec.alpha :as s])) (:require [cljs.spec.alpha :as s]))
(s/def :contacts/contacts map?) ;; {id (string) contact (map)} (s/def :contacts/contacts (s/nilable map?)) ;; {id (string) contact (map)}
(s/def :contacts/new-contacts seq?) (s/def :contacts/new-contacts (s/nilable seq?))
(s/def :contacts/new-contact-identity string?) ;;public key of new contact during adding this new contact (s/def :contacts/new-contact-identity (s/nilable string?)) ;;public key of new contact during adding this new contact
(s/def :contacts/new-contact-public-key-error string?) (s/def :contacts/new-contact-public-key-error (s/nilable string?))
(s/def :contacts/contact-identity string?) ;;on showing this contact profile (s/def :contacts/contact-identity (s/nilable string?)) ;;on showing this contact profile
(s/def :contacts/contacts-ui-props map?) (s/def :contacts/contacts-ui-props (s/nilable map?))
(s/def :contacts/contact-list-ui-props map?) (s/def :contacts/contact-list-ui-props (s/nilable map?))
(s/def :contacts/contacts-click-handler (s/nilable fn?)) ;;used in modal list (for example for wallet) (s/def :contacts/contacts-click-handler (s/nilable fn?)) ;;used in modal list (for example for wallet)
(s/def :contacts/contacts-click-action (s/nilable keyword?)) ;;used in modal list (for example for wallet) (s/def :contacts/contacts-click-action (s/nilable keyword?)) ;;used in modal list (for example for wallet)
(s/def :contacts/contacts-click-params map?) ;;used in modal list (for example for wallet) (s/def :contacts/contacts-click-params (s/nilable map?)) ;;used in modal list (for example for wallet)

View File

@ -1,9 +1,9 @@
(ns status-im.discover.specs (ns status-im.discover.specs
(:require [cljs.spec.alpha :as s])) (:require [cljs.spec.alpha :as s]))
(s/def :discoveries/discoveries map?) ;; {id (string) descovery (map)} (s/def :discoveries/discoveries (s/nilable map?)) ;; {id (string) descovery (map)}
(s/def :discoveries/discover-search-tags seq?) (s/def :discoveries/discover-search-tags (s/nilable seq?))
(s/def :discoveries/tags vector?) (s/def :discoveries/tags (s/nilable vector?))
(s/def :discoveries/current-tag map?) (s/def :discoveries/current-tag (s/nilable map?))
(s/def :discoveries/request-discoveries-timer int?) (s/def :discoveries/request-discoveries-timer (s/nilable int?))
(s/def :discoveries/new-discover map?) (s/def :discoveries/new-discover (s/nilable map?))

View File

@ -1,8 +1,8 @@
(ns status-im.navigation.specs (ns status-im.navigation.specs
(:require [cljs.spec.alpha :as s])) (:require [cljs.spec.alpha :as s]))
(s/def :navigation/view-id keyword?) ;;current view (s/def :navigation/view-id (s/nilable keyword?)) ;;current view
(s/def :navigation/modal (s/nilable keyword?)) ;;modal view id (s/def :navigation/modal (s/nilable keyword?)) ;;modal view id
(s/def :navigation/navigation-stack seq?) ;;stack of view's ids (keywords) (s/def :navigation/navigation-stack (s/nilable seq?)) ;;stack of view's ids (keywords)
(s/def :navigation/prev-tab-view-id keyword?) (s/def :navigation/prev-tab-view-id (s/nilable keyword?))
(s/def :navigation/prev-view-id keyword?) (s/def :navigation/prev-view-id (s/nilable keyword?))

View File

@ -1,11 +1,11 @@
(ns status-im.new-group.specs (ns status-im.new-group.specs
(:require [cljs.spec.alpha :as s])) (:require [cljs.spec.alpha :as s]))
(s/def :group/contact-groups map?) ;; {id (string) group (map)} (s/def :group/contact-groups (s/nilable map?)) ;; {id (string) group (map)}
(s/def :group/contact-group-id string?) ;;used during editing contact group (s/def :group/contact-group-id (s/nilable string?)) ;;used during editing contact group
(s/def :group/group-type keyword?) ;;contact group or chat group (s/def :group/group-type (s/nilable keyword?)) ;;contact group or chat group
(s/def :group/new-group map?) ;;used during creating or edeting contact group (s/def :group/new-group (s/nilable map?)) ;;used during creating or edeting contact group
(s/def :group/new-groups (s/nilable vector?)) ;;used during creating or edeting contact groups (s/def :group/new-groups (s/nilable vector?)) ;;used during creating or edeting contact groups
(s/def :group/contacts-group (s/nilable map?)) (s/def :group/contacts-group (s/nilable map?))
(s/def :group/selected-contacts set?) (s/def :group/selected-contacts (s/nilable set?))
(s/def :group/groups-order seq?) ;;list of group ids (s/def :group/groups-order (s/nilable seq?)) ;;list of group ids

View File

@ -2,4 +2,4 @@
(:require [cljs.spec.alpha :as s])) (:require [cljs.spec.alpha :as s]))
;EDIT PROFILE ;EDIT PROFILE
(s/def :profile/profile-edit map?) (s/def :profile/profile-edit (s/nilable map?))

View File

@ -1,6 +1,6 @@
(ns status-im.qr-scanner.specs (ns status-im.qr-scanner.specs
(:require [cljs.spec.alpha :as s])) (:require [cljs.spec.alpha :as s]))
(s/def :qr/qr-codes map?) ;;on scan qr (s/def :qr/qr-codes (s/nilable map?)) ;;on scan qr
(s/def :qr/qr-modal map?) ;;used in qr modal screen (s/def :qr/qr-modal (s/nilable map?)) ;;used in qr modal screen
(s/def :qr/current-qr-context map?) (s/def :qr/current-qr-context (s/nilable map?))

View File

@ -12,24 +12,24 @@
[status-im.discover.specs])) [status-im.discover.specs]))
;GLOBAL ;GLOBAL
(s/def ::current-public-key string?) ;;public key of current logged in account (s/def ::current-public-key (s/nilable string?)) ;;public key of current logged in account
(s/def ::first-run boolean?) ;;true when application running at first time (s/def ::first-run (s/nilable boolean?)) ;;true when application running at first time
(s/def ::was-modal? boolean?) (s/def ::was-modal? (s/nilable boolean?))
(s/def ::rpc-url string?) ;;"http://localhost:8545" (s/def ::rpc-url (s/nilable string?)) ;;"http://localhost:8545"
(s/def ::web3 any?) ;;object? doesn't work (s/def ::web3 (s/nilable any?)) ;;object? doesn't work
(s/def ::webview-bridge any?) ;;object? (s/def ::webview-bridge (s/nilable any?)) ;;object?
(s/def ::status-module-initialized? boolean?) (s/def ::status-module-initialized? (s/nilable boolean?))
(s/def ::status-node-started? (s/nilable boolean?)) (s/def ::status-node-started? (s/nilable boolean?))
(s/def ::toolbar-search map?) (s/def ::toolbar-search (s/nilable map?))
(s/def ::keyboard-height number?) ;;height of native keyboard if shown (s/def ::keyboard-height (s/nilable number?)) ;;height of native keyboard if shown
(s/def ::keyboard-max-height number?) (s/def ::keyboard-max-height (s/nilable number?))
(s/def ::orientation keyword?) ;;:unknown - not used (s/def ::orientation (s/nilable keyword?)) ;;:unknown - not used
(s/def ::network-status (s/nilable keyword?)) ;;:online - presence of internet connection in the phone (s/def ::network-status (s/nilable keyword?)) ;;:online - presence of internet connection in the phone
;NODE ;NODE
(s/def ::sync-listening-started boolean?) (s/def ::sync-listening-started (s/nilable boolean?))
(s/def ::sync-state keyword?) (s/def ::sync-state (s/nilable keyword?))
;NETWORK ;NETWORK
(s/def ::network keyword?) ;;network name :testnet (s/def ::network (s/nilable keyword?)) ;;network name :testnet
(s/def ::db (allowed-keys :opt-un (s/def ::db (allowed-keys :opt-un
[::current-public-key [::current-public-key

View File

@ -1,12 +1,12 @@
(ns status-im.transactions.specs (ns status-im.transactions.specs
(:require [cljs.spec.alpha :as s])) (:require [cljs.spec.alpha :as s]))
(s/def :transactions/transactions map?) ;; {id (string) transaction (map)} (s/def :transactions/transactions (s/nilable map?)) ;; {id (string) transaction (map)}
(s/def :transactions/transactions-queue map?) ;; {id (string) transaction (map)} (s/def :transactions/transactions-queue (s/nilable map?)) ;; {id (string) transaction (map)}
(s/def :transactions/selected-transaction map?) (s/def :transactions/selected-transaction (s/nilable map?))
(s/def :transactions/confirm-transactions map?) (s/def :transactions/confirm-transactions (s/nilable map?))
(s/def :transactions/confirmed-transactions-count int?) (s/def :transactions/confirmed-transactions-count (s/nilable int?))
(s/def :transactions/transactions-list-ui-props map?) (s/def :transactions/transactions-list-ui-props (s/nilable map?))
(s/def :transactions/transaction-details-ui-props map?) (s/def :transactions/transaction-details-ui-props (s/nilable map?))
(s/def :transactions/wrong-password-counter int?) (s/def :transactions/wrong-password-counter (s/nilable int?))
(s/def :transactions/wrong-password? boolean?) (s/def :transactions/wrong-password? (s/nilable boolean?))