Skip to content

Commit

Permalink
doc: Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Sep 15, 2022
1 parent 9fe8462 commit 75bb08d
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
51 changes: 51 additions & 0 deletions react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,57 @@ declare const Watermark: React.ForwardRefExoticComponent<WatermarkProps & React.
export default Watermark;
```

**`@uiw/watermark.js`**

```ts
export interface WatermarkOptions {
/** watermark text content */
content?: string;
/**
* When the watermark is drawn, the rotation angle, in `°`. @default `-22`
*/
rotate?: number;
/**
* High-definition print image source, for high-definition screen display,
* it is recommended to use 2x or 3x image, and priority to use image rendering watermark.
*/
image?: string;
/** Horizontal spacing between watermarks. @default `212` */
gapX?: number;
/** vertical spacing between watermarks. @default `222` */
gapY?: number;
/** width of watermark. @default `120` */
width?: number;
/** height of watermark @default `64` */
height?: number;
/**
* The vertical offset of the watermark drawn on the canvas.
* Normally, the watermark is drawn in the middle position, ie `offsetTop = gapY / 2`
*/
offsetLeft?: number;
/**
* The horizontal offset of the watermark drawn on the canvas, under normal circumstances,
* the watermark is drawn in the middle position, ie `offsetTop = gapX / 2`
*/
offsetTop?: number;
/** text size @default `16` */
fontSize?: number;
/** text family @default `sans-serif` */
fontFamily?: string;
/** text weight @default `normal` */
fontWeight?: 'normal' | 'light' | 'weight' | number;
/** text color @default `rgba(0,0,0,.15)` */
fontColor?: string;
/** text style */
fontStyle?: CanvasFillStrokeStyles['fillStyle'];
}
export default class Watermark {
option: WatermarkOptions;
constructor(options: WatermarkOptions);
create(): Promise<string>;
}
```

## Development

1. Install
Expand Down
2 changes: 1 addition & 1 deletion website/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Version = styled.sup`
export default function App() {
const version = VERSION;
return (
<Watermark content="React Watermark">
<Watermark content="React Watermark (uiw)">
<Warpper className="wmde-markdown-color">
<GitHubCorners fixed target="__blank" zIndex={10} href="https://github.com/uiwjs/react-monorepo-template" />
<Header>
Expand Down

0 comments on commit 75bb08d

Please sign in to comment.