konfeti - v0.6.0
    Preparing search index...

    Function defineShape

    • Register Custom Shape. Declare its options on ShapeRegistry first; the name then becomes a typed shapes[].type. Registering the same name again replaces the definition.

      Type Parameters

      • K extends never

      Parameters

      Returns void

      TypeError for built-in names

      declare module "konfeti" {
      interface ShapeRegistry {
      diamond: { sharpness?: number };
      }
      }

      defineShape("diamond", {
      path: ({ sharpness = 0.5 }) => `M12 0L${24 - sharpness * 12} 12L12 24L${sharpness * 12} 12Z`,
      });

      Konfeti.fire({ shapes: [{ type: "diamond", sharpness: 0.8 }] });