Skip to content

Commit 2ca7cad

Browse files
authored
Merge pull request #53 from blocknotes/signatures/update-rbs-signatures
Update RBS signatures
2 parents 6da4991 + 0c1f2d0 commit 2ca7cad

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
run: cd spec/dummy_rails && bundle exec rails db:migrate
3434

3535
- name: Run tests
36-
#env:
37-
# RUBYOPT: '-rbundler/setup -rrbs/test/setup'
38-
# RBS_TEST_TARGET: 'TinyAdmin::*'
36+
env:
37+
RUBYOPT: '-rbundler/setup -rrbs/test/setup'
38+
RBS_TEST_TARGET: 'TinyAdmin::*'
3939
run: bin/rspec --profile

sig/tiny_admin/field.rbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ module TinyAdmin
55
attr_reader title: String
66
attr_reader type: Symbol
77

8-
def initialize: (name: String, title: String, type: Symbol, options: Hash[Symbol, String]) -> void
8+
def initialize: (name: String, title: String, type: Symbol, ?options: Hash[Symbol, String]) -> void
99

1010
def apply_call_option: (untyped) -> void
1111

12-
def translate_value: (untyped) -> String?
12+
def translate_value: (untyped) -> untyped
1313

14-
def self.create_field: (name: String, ?title: String?, ?type: Symbol?, ?options: Hash[Symbol, untyped]) -> Field
14+
def self.create_field: (name: String | Symbol, ?title: String?, ?type: Symbol?, ?options: Hash[Symbol, untyped]?) -> Field
1515
end
1616
end

sig/tiny_admin/plugins/active_record_repository.rbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ module TinyAdmin
55

66
def collection: () -> untyped
77

8-
def fields: (options: Hash[untyped, untyped]?) -> Hash[String, Field]
8+
def fields: (?options: Hash[untyped, untyped]?) -> Hash[String, Field]
99

1010
def find: (untyped) -> untyped
1111

12-
def index_record_attrs: (untyped, fields: Hash[untyped, untyped]?) -> Hash[untyped, untyped]
12+
def index_record_attrs: (untyped, ?fields: Hash[untyped, untyped]?) -> Hash[untyped, untyped]
1313

1414
def index_title: () -> String
1515

16-
def list: (page: Integer, limit: Integer, sort: untyped?, filters: untyped?) -> Array[untyped]
16+
def list: (?page: Integer, ?limit: Integer, ?sort: untyped?, ?filters: untyped?) -> [Array[untyped], Integer]
1717

1818
def show_title: (untyped) -> String
1919

sig/tiny_admin/section.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ module TinyAdmin
55
attr_reader path: String
66
attr_reader slug: String?
77

8-
def initialize: (name: String, ?slug: String?, ?path: String?, ?options: Hash[Symbol, String]) -> void
8+
def initialize: (name: String, ?slug: String?, ?path: String?, ?options: Hash[Symbol, String]?) -> void
99
end
1010
end

sig/tiny_admin/store.rbs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module TinyAdmin
22
class Store
3-
attr_reader navbar: Array[Section]
3+
attr_reader navbar: Array[Section?]
44
attr_reader pages: Hash[String, Hash[Symbol, untyped]]
55
attr_reader resources: Hash[String, Hash[Symbol, untyped]]
6-
attr_reader settings: Settings
6+
attr_reader settings: untyped
77

8-
def initialize: (Settings) -> void
8+
def initialize: (untyped) -> void
99

1010
def prepare_sections: (Array[untyped], logout: TinyAdmin::Section?) -> void
1111

@@ -15,7 +15,7 @@ module TinyAdmin
1515

1616
def add_page_section: (String, Hash[Symbol, untyped]) -> TinyAdmin::Section
1717

18-
def add_resource_section: (String, Hash[Symbol, untyped]) -> TinyAdmin::Section
18+
def add_resource_section: (String, Hash[Symbol, untyped]) -> TinyAdmin::Section?
1919

2020
def add_url_section: (String, Hash[Symbol, untyped]) -> TinyAdmin::Section
2121
end

sig/tiny_admin/support.rbs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
module TinyAdmin
22
class Support
3-
def self.call: (?untyped, options: Array[String]?) -> String?
3+
def self.call: (?untyped, ?options: Array[String]) -> untyped
44

5-
def self.downcase: (?untyped, options: Array[String]?) -> String?
5+
def self.downcase: (?untyped, ?options: Array[String]) -> String?
66

7-
def self.format: (?untyped, options: Array[String]?) -> String?
7+
def self.format: (?untyped, ?options: Array[String]) -> String?
88

9-
def self.label_for: (?untyped, options: Array[String]?) -> String?
9+
def self.label_for: (?untyped, ?options: Array[String]) -> untyped
1010

11-
def self.round: (?untyped, options: Array[String]?) -> String?
11+
def self.round: (?untyped, ?options: Array[String]) -> untyped
1212

13-
def self.strftime: (?untyped, options: Array[String]?) -> String?
13+
def self.strftime: (?untyped, ?options: Array[String]) -> String?
1414

15-
def self.to_date: (?untyped, options: Array[String]?) -> String?
15+
def self.to_date: (?untyped, ?options: Array[String]) -> String?
1616

17-
def self.upcase: (?untyped, options: Array[String]?) -> String?
17+
def self.upcase: (?untyped, ?options: Array[String]) -> String?
1818
end
1919
end

0 commit comments

Comments
 (0)