-
-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add typing on document type, add text interface
- Loading branch information
Showing
6 changed files
with
75 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package text | ||
|
||
import ( | ||
"fmt" | ||
v2 "github.com/johnfercher/maroto/pkg/v2" | ||
) | ||
|
||
type text struct { | ||
value string | ||
_type v2.DocumentType | ||
components []v2.Component | ||
} | ||
|
||
func New(value string) *text { | ||
return &text{ | ||
_type: v2.Text, | ||
value: value, | ||
} | ||
} | ||
|
||
func (d *text) Render() { | ||
fmt.Println(d.value) | ||
for _, component := range d.components { | ||
component.Render() | ||
} | ||
} | ||
|
||
func (d *text) GetType() string { | ||
return d._type.String() | ||
} | ||
|
||
func (d *text) Add(_ ...v2.Component) { | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters