New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cardsgame/types

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cardsgame/types - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

58

index.d.ts

@@ -1,4 +0,2 @@

/**
* Entity
*/
// === Entity ===

@@ -13,3 +11,3 @@ type EntityID = number

type: string
data?: unknown // & PrivateAttributeChangeData
data?: unknown

@@ -23,14 +21,2 @@ /**

// type PrivateAttributeChangeData = {
// path: number[]
// owner?: string
// public: boolean
// attribute: string
// value: any
// }
/**
* Event created by player on client
* while interacting with game elements or UI
*/
type ClientPlayerEvent = {

@@ -42,3 +28,2 @@ /**

command?: string
/**

@@ -48,21 +33,13 @@ * Interaction-related events ("click", "touchstart"...)

event?: string
/**
* Path to target Entity.
* As array of numbers: `[0, 2, 0]`
* Ar a string: `"0,2,0"` (no spaces)
* TODO: ^ Decide which one we're gonna keep...
* Custom command's data.
*/
entityPath?: number[] | string
data?: any
/**
* Custom command's data.
* Path to target Entity as an array: `[0,2,0]`
*/
data?: any
entityPath?: number[]
}
/**
* Type of the element which player interacted with
*/
// type PlayerEventTargetType = "Entity" | "UIElement"
type PlayerInteractionEvent = { type: string; data?: any }

@@ -80,14 +57,15 @@ /**

// 1. Transform the type to flag all the undesired keys as 'never'
type FlagExcludedType<Base, Type> = {
[Key in keyof Base]: Base[Key] extends Type ? never : Key
// === Utility types ===
interface AnyClass extends Function {
new (...args: any[]): any
}
// 2. Get the keys that are not flagged as 'never'
type AllowedNames<Base, Type> = FlagExcludedType<Base, Type>[keyof Base]
type AllowArrays<T> = { [prop in keyof T]: T[prop] | Array<T[prop]> }
// 3. Use this with a simple Pick to get the right interface, excluding the undesired type
type OmitType<Base, Type> = Pick<Base, AllowedNames<Base, Type>>
// 4. Exclude the Function type to only get properties
type ConstructorType<T> = OmitType<T, Function>
// Author: https://stackoverflow.com/a/55479659/1404284
type NonFunctionPropertyNames<T> = {
// eslint-disable-next-line @typescript-eslint/ban-types
[K in keyof T]: T[K] extends Function ? never : K
}[keyof T]
type NonFunctionProperties<T> = Pick<T, NonFunctionPropertyNames<T>>
{
"name": "@cardsgame/types",
"version": "0.7.0",
"version": "0.8.0",
"description": "",
"author": "Darek Greenly (https://darekgreenly.com)",
"license": "ISC",
"license": "MIT",
"types": "index",
"gitHead": "db08f5674a86f730a75faee37414299079fd8eaf"
"gitHead": "a44fb0f1391342ef8d0ab9a8bac0648afa73ae2d"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc