README.md in rbs2ts-1.1.0 vs README.md in rbs2ts-1.2.0
- old
+ new
@@ -1,8 +1,8 @@
# Rbs2ts
-Convert RBS to TypeScript type definition.
+A RubyGem that converts Ruby RBS to TypeScript definitions.
## Installation
```ruby
gem install rbs2ts
@@ -86,10 +86,18 @@
required_keyword: String,
?optional_keyword: Integer?,
**String rest_keywords
) -> [{ s: String, f: Float }?]
end
+
+module Module
+ def func: (String, Integer) -> { str: String, int: Integer }
+end
+
+interface _Interface
+ def func: (String, Integer) -> { str: String, int: Integer }
+end
```
to TypeScript
```typescript
@@ -167,20 +175,20 @@
allArguments(requiredPositional: string, optionalPositional?: number | null | undefined, restPositionalsS?: string[], trailingPositionalS?: number, arg1?: { requiredKeyword: string, optionalKeyword?: number | null | undefined, [key: string]: unknown; }): [({
s: string;
f: number;
} | null | undefined)];
};
-```
----
+export namespace Module {
+ export declare function func(arg1: string, arg2: number): {
+ str: string;
+ int: number;
+ };
+};
-## ToDo
-
-- [x] Literal type
-- [ ] Interface type
-- [x] Literal type
-- [x] Tuple Type
-- [x] Base Types
-- [x] Method Type (Argument Types and Return Types)
-- [x] Class declaration
-- [ ] Module declaration
-- [ ] Interface declaration
+export interface Interface {
+ func(arg1: string, arg2: number): {
+ str: string;
+ int: number;
+ };
+};
+```