Change UserData in IKeyValue[]

This commit is contained in:
Guillaume Tauzin 2022-10-18 14:13:47 +02:00
parent d40cd8cf8e
commit cd620e2c1f
5 changed files with 12 additions and 8 deletions

View file

@ -1,4 +1,5 @@
using System.Runtime.Serialization;
using System.Collections.Generic;
namespace SVGLDLibs.Models
{
@ -149,6 +150,6 @@ namespace SVGLDLibs.Models
* User data that can be used for data storage or custom SVG
*/
[DataMember(EmitDefaultValue = false)]
public object userData;
public Dictionary<string, string> userData;
}
}

View file

@ -192,11 +192,7 @@ describe.concurrent('Models test suite', () => {
],
CustomSVG: 'string',
Style: {},
UserData: {
additionalProp1: 'string',
additionalProp2: 'string',
additionalProp3: 'string'
}
UserData: []
};
it('AvailableContainerModel', async() => {

View file

@ -6,6 +6,7 @@ import { IAction } from './IAction';
import { IMargin } from './IMargin';
import { Orientation } from '../Enums/Orientation';
import { Position } from '../Enums/Position';
import { IKeyValue } from './IKeyValue';
/** Model of available container used in application configuration */
export interface IAvailableContainer {
@ -161,5 +162,5 @@ export interface IAvailableContainer {
* (optional)
* User data that can be used for data storage or custom SVG
*/
UserData?: object
UserData?: IKeyValue[]
}

View file

@ -3,6 +3,7 @@ import { PositionReference } from '../Enums/PositionReference';
import { IMargin } from './IMargin';
import { Orientation } from '../Enums/Orientation';
import { Position } from '../Enums/Position';
import { IKeyValue } from './IKeyValue';
/**
* Properties of a container
@ -122,5 +123,5 @@ export interface IContainerProperties {
* (optional)
* User data that can be used for data storage or custom SVG
*/
userData?: object
userData?: IKeyValue[]
}

View file

@ -0,0 +1,5 @@
/* eslint-disable @typescript-eslint/naming-convention */
export interface IKeyValue {
Key: string
Value: string
}