From f2f5ea67f138ff5a318310276c7da9732b768a56 Mon Sep 17 00:00:00 2001 From: pipipi-pikachu Date: Sat, 21 Aug 2021 14:57:40 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=BA=BF=E6=9D=A1=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/configs/lines.ts | 14 +++++++++++--- src/types/slides.ts | 6 ++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/configs/lines.ts b/src/configs/lines.ts index 425bdce9..0237dfe0 100644 --- a/src/configs/lines.ts +++ b/src/configs/lines.ts @@ -1,12 +1,20 @@ +import { LinePoint } from '@/types/slides' + + export interface LinePoolItem { path: string; - style: string; - points: [string, string]; + style: 'solid' | 'dashed'; + points: [LinePoint, LinePoint]; isBroken?: boolean; isCurve?: boolean; } -export const LINE_LIST = [ +interface PresetLine { + type: string; + children: LinePoolItem[]; +} + +export const LINE_LIST: PresetLine[] = [ { type: '直线', children: [ diff --git a/src/types/slides.ts b/src/types/slides.ts index 2bd581ea..97496b99 100644 --- a/src/types/slides.ts +++ b/src/types/slides.ts @@ -286,6 +286,8 @@ export interface PPTShapeElement extends PPTBaseElement { } +export type LinePoint = '' | 'arrow' | 'dot' + /** * 线条元素 * @@ -311,9 +313,9 @@ export interface PPTLineElement extends Omit { type: 'line'; start: [number, number]; end: [number, number]; - style: string; + style: 'solid' | 'dashed'; color: string; - points: [string, string]; + points: [LinePoint, LinePoint]; shadow?: PPTElementShadow; broken?: [number, number]; curve?: [number, number];